1 Abstract

There has already 2 years passed by while Binary.com-is-Rebranding-to-Deriv.com, Here I summarized some previous research papers in Binary.com → Deriv.com and continue from this high-frequency-trading.

if(!suppressPackageStartupMessages(require('BBmisc'))) {
  install.packages('BBmisc', dependencies = TRUE, INSTALL_opts = '--no-lock')
}
suppressPackageStartupMessages(require('BBmisc'))
# suppressPackageStartupMessages(require('rmsfuns'))

pkgs <- c('devtools', 'knitr', 'kableExtra', 'tint', 'dygraphs', 
          'devtools','readr', 'lubridate', 'data.table', 'reprex', 
          'feather', 'purrr', 'quantmod', 'tidyquant', 'plotly', 
          'tibbletime', 'furrr', 'flyingfox', 'tidyr', 'jsonlite', 
          'timetk', 'plyr', 'dplyr', 'stringr', 'magrittr', 'tdplyr', 
          'tidyverse', 'memoise', 'htmltools', 'formattable', 
          'dash', 'dashCoreComponents', 'dashHtmlComponents', ##https://dashr.plotly.com
          'zoo', 'forecast', 'seasonal', 'seasonalview', 'rjson', 
          'rugarch', 'rmgarch', 'mfGARCH', 'sparklyr', 'jcolors', 
          'microbenchmark', 'dendextend', 'lhmetools', 'ggthemr', 
          'stringr', 'pacman', 'profmem', 'DescTools', 'ggthemes', 
          'htmltools', 'echarts4r', 'viridis', 'hrbrthemes')

# https://github.com/mpiktas/midasr
# https://github.com/onnokleen/mfGARCH
# devtools::install_github("business-science/tibbletime")
# devtools::install_github("DavisVaughan/furrr")

suppressAll(lib(pkgs))
# load_pkg(pkgs)

funs <- c('uv_fx.R', 'opt_arma.R', 'multi_seasons.R', 
          'filterFX.R', 'filter_spec.R', 'mv_fx.R', 
          'task_progress.R', 'read_umodels.R', 'convertOHLC.R')
l_ply(funs, function(x) source(paste0('./function/', x)))

# spark_install()

# if(FALSE) {
  # Not run due to side-effects
#   spark_home_set()
#   }
# sc <- spark_connect(master = 'local')

#spark_install()
#sc <- spark_connect(master = 'local')

.cl = FALSE

Sys.setenv(TZ = 'Asia/Tokyo')
## options(knitr.table.format = 'html') will set all kableExtra tables to be 'html', otherwise need to set the parameter on every single table.
options(warn = -1, knitr.table.format = 'html')#, digits.secs = 6)
rm(pkgs, funs)

2 Introduction

By refer to GARCH模型中的ARIMA(p,d,q)参数最优化 and binary.com Interview Question I - Comparison of Univariate GARCH Models, we know Fractional Intergrated GJR-GARCH is the best fit model. This paper we compare the MIDAS, GARCH-MIDAS and Levy Process models. Here I also test another high frequency trading model mcmcsGARCH. These paper might consider as comparison interday trading before start the high frequency trading via Real Time FXCM.

High Frequency Financial Time Series Prediction - Machine Learning Approach introduce multilayer modelling for high-frequency-trading. binary.com Interview Question I - Tick-Data-HiLo For Daily Trading (Blooper) tried to use Hi-Lo daily dataset for modelling but failed. The paper recommend to use complete itraday dataset.

I noticed that buying early in the morning, around 5am eastern time, tends to give lower prices and selling around 10pm eastern time gives you the highest prices. The wording is weird but i want to know your opinions on how time of day affects the bitcoin trading market. Thank you.

Source : Time of day affects trading prices

From above quotes, we can know the seasonality of price trend daily, weekly, monthly or annually etc. MIDAS and mcsGARCH are the models designate for high frequency trading.

A Comparison of GARCH-class Models and MIDAS Regression with Application in Volatility Prediction and Value at Risk Estimation compares GARCH, eGARCH and MIDAS 3 models with normal and student distribution with matrix. The author concludes that the MIDAS model is the most accurate in volatility prediction but there is inconclusive for VaR 1% and 5%.

Note that there does not seem to be an option to use SARMA models in the “rugarch” package, so you will have to let the “S” part go. But if there is a seasonal pattern (and that is quite likely when it comes to tourist arrivals), you will have to account for it somehow. Consider using exogenous seasonal variables (dummies or Fourier terms) in the conditional mean model via the argument external.regressors inside the argument mean.model in function ugarchspec. Alternatively, note that a SARMA model corresponds to a restricted ARMA model. An approximation of SARMA could thus be an ARMA with the appropriate lag order but without the SARMA-specific parameter restrictions (since those might not be available in “rugarch”).

The quotes above describe about the seasonal factors onto the model which is similar with MIDAS model, kindly refer to Fitting ARIMA-GARCH model using “rugarch” package.

3 Data

3.1 Tick Data

3.1.1 Get Data

Due to the dataset gather via getSymbols('JPY=X', src='av', api.key=api, periodicity='intraday') is tidied but only 100 observations. Moreover I cannot select the time period from few years ago, therefore here I omit it and use the intraday data gather from real-time-fxcm/data/USDJPY/ from Y2015W1 to Y2018W27, due to the dataset is tick-data-base and more than 1 million observation per file (per week) and there has 4 years dataset where. Here I need to backtest day-by-day. There will be spent a long time to do.

cr_code <- c('AUDUSD=X', 'EURUSD=X', 'GBPUSD=X', 'CHF=X', 'CAD=X', 'CNY=X', 'JPY=X')

names(cr_code) <- c('AUDUSD', 'EURUSD', 'GBPUSD', 'USDCHF', 'USDCAD', 'USDCNY', 'USDJPY')
# names(cr_code) <- c('USDAUD', 'USDEUR', 'USDGBP', 'USDCHF', 'USDCAD', 'USDCNY', 'USDJPY')

dtr <- str_extract_all(getwd(), '.*/', '')[1]
dtr1 <- paste0(dtr, 'real-time-fxcm/data/')

## Read presaved FXCM data.
# mbase <- sapply(names(cr_code), function(x) readRDS(paste0('./data/', x, '.rds')) %>% na.omit)

fls <- sapply(names(cr_code), function(x) {
  dtr1 <- paste0(dtr1, x)
  list.files(dtr1, pattern = '^Y[0-9]{4}W[0-9]{1,2}.rds$') %>% 
    str_replace_all('.rds', '')
  })
fls[lengths(fls) == 0] <- NA_character_
fls[is.na(fls)] <- NULL

# AUDUSD <- sapply(fls[[1]], read_rds)
# EURUSD <- sapply(fls[[2]], read_rds)
# GBPUSD <- sapply(fls[[3]], read_rds)
# USDCHF <- sapply(fls[[4]], read_rds)
# USDCAD <- sapply(fls[[5]], read_rds)
# USDCNY <- sapply(fls[[6]], read_rds)
# mbase <- llply(as.list(fls[[7]]), read_rds) #185 files where 1 files contains 1 million observation.

## Here I take USDJPY as example...
dtr1s <- paste0(dtr1, names(fls[length(fls)]))
fs <- list.files(dtr1s, pattern = '^Y[0-9]{4}W[0-9]{1,2}.rds$') %>% 
  str_replace_all('.rds', '')
# eval(parse(text = paste0(fs, "<- readRDS('", fls[[7]], "') %>% as_tibble")))

t.unit <- c('seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'quarters', 'quarters')
## https://www.alphavantage.co/
## https://www.alphavantage.co/support/#api-key
# api = 'UL7EPVVEGDVC3TXC'
# getSymbols('JPY=X', src='av', api.key=api, periodicity='intraday')

binary.com Interview Question I - Multivariate GARCH Models concludes that the multivariate will be more accurate but due to save time, here I only use univariate for models comparison.

Due to high volume of dataset, here I only use USDJPY since the variance is higher than the rest of currencies.

## Read raw dataset.
#Y2015W1 <- read_rds(paste0(dtr1, '/', fls[[7]][1], '.rds')) %>% as_tibble

eval(parse(text = paste0(fs[1], "<- readRDS('", dtr1, "/", 
                         names(fls[length(fls)]), '/', fls[length(fls)][[1]][1], 
                         ".rds') %>% as_tibble")))

## raw dataset
Y2015W1
## # A tibble: 1,775,999 x 3
##    DateTime                  Bid   Ask
##    <fct>                   <dbl> <dbl>
##  1 01/04/2015 22:00:00.165  120.  121.
##  2 01/04/2015 22:00:00.197  120.  121.
##  3 01/04/2015 22:00:00.401  120.  121.
##  4 01/04/2015 22:00:00.712  120.  121.
##  5 01/04/2015 22:00:00.742  120.  121.
##  6 01/04/2015 22:00:00.786  120.  121.
##  7 01/04/2015 22:00:00.920  120.  121.
##  8 01/04/2015 22:00:00.926  120.  121.
##  9 01/04/2015 22:00:01.253  120.  121.
## 10 01/04/2015 22:00:01.259  120.  121.
## # ... with 1,775,989 more rows

Above table shows the raw tick-dataset (shows price fluctuation in mili-seconds). As we know that the variance in unit mili-second is almost 0. Therefore I refer to High Frequency GARCH: The multiplicative component GARCH (mcsGARCH) model and use 1 minute as 1 time unit, convert from univariate ask and univariate bid to be OHLC dataset.

3.1.2 Tidy Data

For example, the taylor data set from the forecast package contains half-hourly electricity demand data from England and Wales over about 3 months in 2000. It was defined as taylor <- msts(x, seasonal.periods=c(48,336).

Source Seasonal periods

A Review of Literature on Time Zone Difference and Trade study about trading across timezone and different country, if the timezone difference will affect the trading.

I would like to use R for time series analysis. I want to make a time-series model and use functions from the packages timeDate and forecast. I have intraday data in the CET time zone (15 minutes data, 4 data points per hour). On March 31st daylight savings time is implemented and I am missing 4 data points of the 96 that I usually have. On October 28th I have 4 data points too many as time is switched back. For my time series model I always need 96 data points, as otherwise the intraday seasonality gets messed up. Do you have any experiences with this? Do you know an R function or a package that would be of help to automat such data handling - something elegant? Thank you!

I had a similar problem with hydrological data from a sensor. My timestamps were in UTC+1 (CET) and did not switch to daylight saving time (UTC+2, CEST). As I didn’t want my data to be one hour off (which would be the case if UTC were used) I took the %z conversion specification of strptime. In ?strptime you’ll find: %z Signed offset in hours and minutes from UTC, so -0800 is 8 hours behind UTC. For example: In 2012, the switch from Standard Time to DST occured on 2012-03-25, so there is no 02:00 on this day. If you try to convert “2012-03-25 02:00:00” to a POSIXct-Object,

## https://stackoverflow.com/questions/29202021/r-how-to-extract-dates-from-a-time-series
getTStime <- function(ats){
  start <- start(ats)
  end <- end(ats)
  time <- list()
  time[[1]] <- start
  m <- 2
  while(!(identical(start, end))){
    start[2] <- start[2] + 1
    if (start[2]==1441){ #mins per day
      start[1] <- start[1] + 1
      start[2] <- 1
    }
    time[[m]] <- start
    m <- m + 1
  }
  return(time)
}

## https://stackoverflow.com/questions/13865172/handling-data-on-the-days-when-we-switch-to-daylight-savings-time-and-back-in-r
#> as.POSIXct("2012-03-25 02:00:00", tz="Europe/Vienna")
#[1] "2012-03-25 CET"
#
## you don't get an error or a warning, you just get date without the time (this behavior is documented).
## Using `format = "%z"` gives the desired result:
#
#> as.POSIXct("2012-03-25 02:00:00 +0100", format="%F %T %z", tz="Europe/Vienna")
#[1] "2012-03-25 03:00:00 CEST"

## function
as.POSIXct.no.dst <- function (
  x, tz = '', format='%Y-%m-%d %H:%M', offset='+0100', ...) {
  x <- paste(x, offset)
  format <- paste(format, '%z')
  res <- as.POSIXct(x, tz, format=format, ...)
  return(res)
  }

Source : Handling data on the days when we switch to daylight savings time and back in R

Why is this xts frequency always 1? talk about the frequency of xts dataset and we need to use zoo to convert it.

So far, we have considered relatively simple seasonal patterns such as quarterly and monthly data. However, higher frequency time series often exhibit more complicated seasonal patterns. For example, daily data may have a weekly pattern as well as an annual pattern. Hourly data usually has three types of seasonality: a daily pattern, a weekly pattern, and an annual pattern. Even weekly data can be challenging to forecast as it typically has an annual pattern with seasonal period of 365.25/7≈52.179 on average. … The top panel of Figure 11.1 shows the number of retail banking call arrivals per 5-minute interval between 7:00am and 9:05pm each weekday over a 33 week period. The bottom panel shows the first three weeks of the same time series. There is a strong daily seasonal pattern with frequency 169 (there are 169 5-minute intervals per day), and a weak weekly seasonal pattern with frequency 169 × 5 = 845. (Call volumes on Mondays tend to be higher than the rest of the week.) If a longer series of data were available, we may also have observed an annual seasonal pattern.

Source : 11.1 Complex seasonality

## Convert the univariate price to be OHLC price in `minutes` unit.
Y2015W1_min1 <- Y2015W1 %>% 
  convertOHLC(combine = TRUE, trade = FALSE, .unit = t.unit[2]) %>% 
  bind_rows #combined `ask/bid` price
Y2015W1_min1
## # A tibble: 7,200 x 9
##    index               BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow
##    <dttm>                <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
##  1 2015-01-05 00:01:00    120.    121.   120.     121.    121.    121.   121.
##  2 2015-01-05 00:02:00    121.    121.   120.     121.    121.    121.   121.
##  3 2015-01-05 00:03:00    121.    121.   121.     121.    121.    121.   121.
##  4 2015-01-05 00:04:00    121.    121.   121.     121.    121.    121.   121.
##  5 2015-01-05 00:05:00    121.    121.   120.     121.    121.    121.   121.
##  6 2015-01-05 00:06:00    121.    121.   120.     120.    121.    121.   121.
##  7 2015-01-05 00:07:00    120.    121.   120.     121.    121.    121.   120.
##  8 2015-01-05 00:08:00    121.    121.   121.     121.    121.    121.   121.
##  9 2015-01-05 00:09:00    121.    121.   121.     121.    121.    121.   121.
## 10 2015-01-05 00:10:00    121.    121.   121.     121.    121.    121.   121.
## # ... with 7,190 more rows, and 1 more variable: AskClose <dbl>
#suppressWarnings(Y2015W1 <- tbl %>% 
#       dplyr::select(date, close) %>% tk_xts %>% 
#       auto.arima(seasonal = FALSE))

## Count the observation in order to model seasonal frequency model.
Y2015W1_min1 %>% 
  dplyr::select(index) %>% 
  ddply(.(date(index)), summarise, n = length(index)) %>% 
  as_tibble
## # A tibble: 6 x 2
##   `date(index)`     n
##   <date>        <int>
## 1 2015-01-05     1439
## 2 2015-01-06     1440
## 3 2015-01-07     1440
## 4 2015-01-08     1440
## 5 2015-01-09     1440
## 6 2015-01-10        1

Kindly refer to section Seasonal Data or Seasonal periods to know the seasonality dataset. High Frequency GARCH: The multiplicative component GARCH (mcsGARCH) model use the dataset start from 00:01:00 but not 00:00:00, therefore above dataset shows the last observation will be the start of next day.

# tsz <- llply(fls[[7]], function(x) {
#     y <- read_rds(x) %>% 
#       convertOHLC(combine = TRUE, trade = FALSE, .unit = t.unit[2]) %>% 
#         bind_rows %>% 
#         dplyr::filter(index == head(index, 1) | 
#                       index == tail(index, 1)) %>% 
#       mutate(diff = difftime(index, lag(index, 1), units = 'mins'))
#     }) %>% bind_rows %>% as_tibble %>% arrange(index)
# saveRDS(tsz, 'C:/Users/scibr/Documents/GitHub/scibrokes/real-time-fxcm/data/USDJPY/tsz.rds')

## The daylight saving convertion in not tally.
tsz <- read_rds(paste0(dtr1s, '/tsz.rds')) %>% 
  dplyr::filter(index >= ymd_hms('2015-01-05 00:00:00', tz = 'Europe/Athens'))
tsz
## # A tibble: 368 x 10
##    index               AskOpen AskHigh AskLow AskClose BidOpen BidHigh BidLow
##    <dttm>                <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
##  1 2015-01-05 00:01:00    121.    121.   121.     121.    120.    121.   120.
##  2 2015-01-10 00:00:00    119.    119.   119.     119.    118.    118.   118.
##  3 2015-01-12 00:01:00    118.    118.   118.     118.    118.    118.   118.
##  4 2015-01-16 23:57:00    117.    118.   117.     118.    117.    118.   117.
##  5 2015-01-19 00:01:00    117.    118.   117.     117.    117.    117.   117.
##  6 2015-01-23 23:59:00    118.    118.   118.     118.    118.    118.   118.
##  7 2015-01-26 00:01:00    118.    118.   118.     118.    118.    118.   117.
##  8 2015-01-30 23:59:00    118.    118.   118.     118.    117.    118.   117.
##  9 2015-02-02 00:01:00    117.    117.   117.     117.    117.    117.   117.
## 10 2015-02-07 00:00:00    119.    119.   119.     119.    119.    119.   119.
## # ... with 358 more rows, and 2 more variables: BidClose <dbl>, diff <drtn>
## count the frequency of weekly observation.
tsz %>% dplyr::count(diff) %>% 
  kable(caption = 'Count data point') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Count data point
diff n
1228 mins 1
1276 mins 1
1657 mins 1
2407 mins 1
2449 mins 1
2650 mins 1
2834 mins 1
3777 mins 1
5251 mins 1
5395 mins 1
5495 mins 1
5521 mins 1
5522 mins 1
5620 mins 1
5638 mins 2
5763 mins 2
6355 mins 1
6831 mins 1
6896 mins 1
7180 mins 1
7181 mins 1
7187 mins 1
7190 mins 1
7192 mins 1
7193 mins 1
7194 mins 7
7195 mins 8
7196 mins 9
7197 mins 8
7198 mins 41
7199 mins 84
NA mins 184
## missing observation.
tsz %>% dplyr::filter(diff <= 6000)
## # A tibble: 18 x 10
##    index               AskOpen AskHigh AskLow AskClose BidOpen BidHigh BidLow
##    <dttm>                <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
##  1 2015-12-24 20:02:00    120.    120.   120.     120.    120.    120.   120.
##  2 2015-12-31 20:03:00    120.    120.   120.     120.    120.    120.   120.
##  3 2016-02-03 14:58:00    119.    119.   119.     119.    119.    119.   119.
##  4 2016-04-14 15:34:00    109.    109.   109.     109.    109.    109.   109.
##  5 2016-04-19 23:15:00    109.    109.   109.     109.    109.    109.   109.
##  6 2016-05-03 16:08:00    106.    106.   106.     106.    106.    106.   106.
##  7 2016-11-17 21:41:00    110.    110.   110.     110.    110.    110.   110.
##  8 2016-12-30 23:59:00    117.    117.   117.     117.    117.    117.   117.
##  9 2017-01-06 23:59:00    117.    117.   117.     117.    117.    117.   117.
## 10 2017-04-17 20:31:00    109.    109.   109.     109.    109.    109.   109.
## 11 2017-04-25 16:53:00    111.    111.   111.     111.    111.    111.   111.
## 12 2017-05-15 21:18:00    114.    114.   114.     114.    114.    114.   114.
## 13 2017-05-23 20:12:00    112.    112.   112.     112.    112.    112.   112.
## 14 2017-06-29 19:37:00    112.    112.   112.     112.    112.    112.   112.
## 15 2017-08-08 03:39:00    111.    111.   111.     111.    111.    111.   111.
## 16 2017-12-29 23:58:00    113.    113.   113.     113.    113.    113.   113.
## 17 2018-01-06 01:00:00    113.    113.   113.     113.    113.    113.   113.
## 18 2018-01-06 01:00:00    113.    113.   113.     113.    113.    113.   113.
## # ... with 2 more variables: BidClose <dbl>, diff <drtn>
## https://stackoverflow.com/questions/34454947/why-is-this-xts-frequency-always-1
## https://www.stat.berkeley.edu/~s133/dates.html
## https://stackoverflow.com/questions/45070078/convert-forecast-time-produced-by-arima-into-standard-date-time
#How to extract below index to datetime
#Y2015W1 %>% tk_ts(end = c(1440, 7200), frequency = 1440) %>% attributes %>% .$index %>% as.POSIXct(tz = 'UTC', origin = '1970-01-01') %>% force_tz(tz = 'Europe/Athens')
Y2015W1_min1 %>% 
  tk_ts(end = c(3, 7200), frequency = 1440) %>% 
  .[,1:ncol(.)] %>% 
  head #1440 * 5 = 7200
## Time Series:
## Start = c(3, 1) 
## End = c(3, 6) 
## Frequency = 1440 
##          BidOpen BidHigh  BidLow BidClose AskOpen AskHigh  AskLow AskClose
## 3.000000 120.474 120.542 120.442  120.502 120.534 120.638 120.520  120.608
## 3.000694 120.524 120.570 120.484  120.538 120.592 120.671 120.566  120.610
## 3.001389 120.568 120.588 120.533  120.568 120.624 120.678 120.588  120.612
## 3.002083 120.570 120.606 120.508  120.539 120.614 120.708 120.566  120.668
## 3.002778 120.544 120.594 120.472  120.576 120.668 120.714 120.506  120.598
## 3.003472 120.572 120.576 120.492  120.497 120.598 120.629 120.506  120.605
Y2015W1_min1 %>% 
  head %>% 
  zooreg(frequency = 1440)
##      index               BidOpen BidHigh BidLow  BidClose AskOpen AskHigh
## 1(1) 2015-01-05 00:01:00 120.474 120.542 120.442 120.502  120.534 120.638
## 1(2) 2015-01-05 00:02:00 120.524 120.570 120.484 120.538  120.592 120.671
## 1(3) 2015-01-05 00:03:00 120.568 120.588 120.533 120.568  120.624 120.678
## 1(4) 2015-01-05 00:04:00 120.570 120.606 120.508 120.539  120.614 120.708
## 1(5) 2015-01-05 00:05:00 120.544 120.594 120.472 120.576  120.668 120.714
## 1(6) 2015-01-05 00:06:00 120.572 120.576 120.492 120.497  120.598 120.629
##      AskLow  AskClose
## 1(1) 120.520 120.608 
## 1(2) 120.566 120.610 
## 1(3) 120.588 120.612 
## 1(4) 120.566 120.668 
## 1(5) 120.506 120.598 
## 1(6) 120.506 120.605
#Y2015W1_min1 %>% tk_ts(end = c(1440, 7200), frequency = 1440) %>% index %>% as.POSIXct(tz = 'UTC', origin = '1970-01-01')

## https://stats.stackexchange.com/questions/144158/daily-time-series-analysis
## http://manishbarnwal.com/blog/2017/05/03/time_series_and_forecasting_using_R/
#How to extract below index to datetime
#Y2015W1_min1 %>% msts(seasonal.periods=c(1440, 7200)) %>% .[,1] %>% as.numeric %>% as.POSIXct(tz = 'UTC', origin = '1970-01-01') %>% force_tz(tz = 'Europe/Athens')
Y2015W1_min1 %>% 
  head %>% 
  msts(seasonal.periods=c(1440, 7200))
## Multi-Seasonal Time Series:
## Start: 1 1
## Seasonal Periods: 1440 7200
## Data:
##           index BidOpen BidHigh  BidLow BidClose AskOpen AskHigh  AskLow
## [1,] 1420383660 120.474 120.542 120.442  120.502 120.534 120.638 120.520
## [2,] 1420383720 120.524 120.570 120.484  120.538 120.592 120.671 120.566
## [3,] 1420383780 120.568 120.588 120.533  120.568 120.624 120.678 120.588
## [4,] 1420383840 120.570 120.606 120.508  120.539 120.614 120.708 120.566
## [5,] 1420383900 120.544 120.594 120.472  120.576 120.668 120.714 120.506
## [6,] 1420383960 120.572 120.576 120.492  120.497 120.598 120.629 120.506
##      AskClose
## [1,]  120.608
## [2,]  120.610
## [3,]  120.612
## [4,]  120.668
## [5,]  120.598
## [6,]  120.605

ts() only can build a year-month seasonal dataset, otherwise need to decimal numeric to figure out what date within a month accordingly. msts() will be more user friendly which is modelling intra-and-inter seasonal dataset. Now I convert all dataset again from UTC to UTC+2 to be a constant weekly seasonal dataset. Due to the trading day is 5 days and 2 rest days, therefore I set a weekly seasonal period instead of daily.

2018 Time Zones - UTC shows that has no change in No changes, UTC all of the period from 2010 to 2019.

From the Wikipedia UTC page: UTC does not change with a change of seasons, but local time or civil time may change if a time zone jurisdiction observes daylight saving time or summer time. For example, UTC is 5 hours ahead of local time on the east coast of the United States during winter, but 4 hours ahead during summer. In other words, when a time zone observes DST, its offset from UTC changes when there’s a DST transition, but that’s that time zone observing DST, not UTC. Without knowing much about PHP time zone handling, it seems strange to me that you can specify “with DST” or “without DST” in a conversion - the time zones themselves specify when DST kicks in… it shouldn’t have to be something you specify yourself.

Source : Does UTC observe daylight saving time?

Due to the UTC timezone has no daylight saving issue, therefore the initial trading time will be a problem where I need to cope with. Handling Data for Daylight-Saving and Non-Daylight-Saving for HFT provides the solution for the timezone issue.

## -------- eval=FALSE --------------
## Now I simply tidy all datasets and save it prior to start the statistical modelling.
llply(fls[[7]], function(x) {
    mbase <- read_rds(x) %>% as_tibble
    ## Convert the univariate price to be OHLC price in `minutes` unit.
    mbase %<>% convertOHLC(.unit = t.unit[2], combine = TRUE) %>% 
        bind_rows #combined `ask/bid` price
    
    y <- x %>% str_replace_all('.rds$', '_tick-to-min1.rds')
    
    saveRDS(mbase, y)
    cat(y, 'saved!\n')
    })

3.2 1 Minute Data

3.2.1 Get and Tidy Data

Due to fxcm/MarketData updated and provides 1 minute, 1 hour, 1 day datasets recently, here I directly download 1 minute dataset and tidy it.

time is based on EST, because our server is in New Jersey USA. it is 5:00PM at the end of the day, which is shown in GMT as 21:00 day light saving or 22:00 without day light saving.

Source : Inconsistency of trading date time #1

From above quote, we can know even the EST converted to UTC will not be 00:00:00, therefore I refer to Handling data on the days when we switch to daylight savings time and back in R as my solution as UTC+2 (daylight saving UTC+3) will get the desired result.

cr_code <- c('EURUSD=X', 'GBPUSD=X', 'CHF=X', 'CAD=X', 'JPY=X')
names(cr_code) <- c('EURUSD', 'GBPUSD', 'USDCHF', 'USDCAD', 'USDJPY')

fls1 <- llply(names(cr_code), function(x) {
    fls <- list.files(paste0(dtr1, x), pattern = '^Y[0-9]{4}W[0-9]{1,2}_m1.rds$')
    if (length(fls) > 0) paste0(dtr1, x, '/', fls)
  })
names(fls1) <- names(cr_code)

dtr1s <- paste0(dtr1, names(fls1[length(fls1)]))
fs1 <- list.files(dtr1s, pattern = '^Y[0-9]{4}W[0-9]{1,2}_m1.rds$') %>% 
  str_replace_all('.rds', '')

## Read raw dataset.
# eval(parse(text = paste0(fs, "<- read_rds('", fls[[7]], "')")))
## Read raw dataset.
eval(parse(text = paste0(fs1[1], "<- read_rds('", fls1[[5]][1], "') %>% as_tibble")))

## raw dataset
Y2015W1_m1
## # A tibble: 7,200 x 9
##    DateTime      BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow AskClose
##    <fct>           <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>    <dbl>
##  1 01/04/2015 2~    120.    121.   120.     121.    121.    121.   121.     121.
##  2 01/04/2015 2~    121.    121.   120.     121.    121.    121.   121.     121.
##  3 01/04/2015 2~    121.    121.   121.     121.    121.    121.   121.     121.
##  4 01/04/2015 2~    121.    121.   121.     121.    121.    121.   121.     121.
##  5 01/04/2015 2~    121.    121.   120.     121.    121.    121.   121.     121.
##  6 01/04/2015 2~    121.    121.   120.     120.    121.    121.   121.     121.
##  7 01/04/2015 2~    120.    121.   120.     121.    121.    121.   120.     121.
##  8 01/04/2015 2~    121.    121.   121.     121.    121.    121.   121.     121.
##  9 01/04/2015 2~    121.    121.   121.     121.    121.    121.   121.     121.
## 10 01/04/2015 2~    121.    121.   121.     121.    121.    121.   121.     121.
## # ... with 7,190 more rows

Now I try to validate the daylight saving date.

# tsz2 <- llply(fls1[[5]], function(x) {
#    y <- read_rds(x) %>% dplyr::filter(DateTime == head(DateTime, 1)|
#                                      DateTime == tail(DateTime, 1)) %>% 
#        mutate(DateTime = DateTime %>% mdy_hms %>% 
#                 .POSIXct(tz = 'Europe/Athens'), 
#               diff = difftime(DateTime, lag(DateTime, 1), units = 'mins'))
#    
#    nch <- y$DateTime[1] %>% substr(nchar(.)+2, nchar(.)+3)
#    y %<>% mutate(
#        nch = nch, DateTime = if_else(
#          nch == '23', DateTime + hours(1), DateTime)) %>% 
#        dplyr::select(-nch)
#    }) %>% bind_rows %>% as_tibble %>% arrange(DateTime)
# saveRDS(tsz2, 'C:/Users/scibr/Documents/GitHub/scibrokes/real-time-fxcm/data/USDJPY/tsz2.rds')

## The daylight saving convertion in not tally.
tsz2 <- read_rds(paste0(dtr1s, '/tsz2.rds')) %>% 
  dplyr::rename(index = DateTime) %>% 
  dplyr::filter(index >= ymd_hms('2015-01-05 00:01:00', tz = 'Europe/Athens'))
tsz2
## # A tibble: 365 x 10
##    index               BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow
##    <dttm>                <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
##  1 2015-01-09 23:59:00    119.    119.   118.     118.    119.    119.   119.
##  2 2015-01-12 00:00:00    118.    118.   118.     118.    118.    118.   118.
##  3 2015-01-16 23:56:00    117.    118.   117.     118.    117.    118.   117.
##  4 2015-01-19 00:00:00    117.    117.   117.     117.    117.    118.   117.
##  5 2015-01-23 23:58:00    118.    118.   118.     118.    118.    118.   118.
##  6 2015-01-26 00:00:00    118.    118.   117.     118.    118.    118.   118.
##  7 2015-01-30 23:58:00    117.    118.   117.     118.    118.    118.   118.
##  8 2015-02-02 00:00:00    117.    117.   117.     117.    117.    117.   117.
##  9 2015-02-06 23:59:00    119.    119.   119.     119.    119.    119.   119.
## 10 2015-02-09 00:00:00    119.    119.   119      119.    119.    119.   119.
## # ... with 355 more rows, and 2 more variables: AskClose <dbl>, diff <drtn>
## count the frequency of weekly observation.
tsz2 %>% dplyr::count(diff) %>% 
  kable(caption = 'Count data point') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Count data point
diff n
5395 mins 1
5521 mins 1
5522 mins 1
5638 mins 2
5759 mins 1
7180 mins 1
7187 mins 1
7190 mins 1
7192 mins 1
7193 mins 1
7194 mins 7
7195 mins 10
7196 mins 13
7197 mins 10
7198 mins 47
7199 mins 85
NA mins 182
## missing observation.
tsz2 %>% dplyr::filter(diff <= 6000)
## # A tibble: 6 x 10
##   index               BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow
##   <dttm>                <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
## 1 2015-12-24 20:01:00    120.    120.   120.     120.    120.    120.   120.
## 2 2015-12-31 20:02:00    120.    120.   120.     120.    120.    120.   120.
## 3 2016-12-30 23:58:00    117.    117.   117.     117.    117.    117.   117.
## 4 2017-01-06 23:58:00    117.    117.   117.     117.    117.    117.   117.
## 5 2017-12-29 23:57:00    113.    113.   113.     113.    113.    113.   113.
## 6 2018-01-05 23:59:00    113.    113.   113.     113.    113.    113.   113.
## # ... with 2 more variables: AskClose <dbl>, diff <drtn>

From above tables, we can know the daylight saving detection and datetime auto convertion is not tally. Here I united all intial observation started from 00:01:00.

3.3 Completion of Data

3.3.1 Data Selection

binary.com 面试试题 I - 单变量数据缺失值管理 and binary.com面试试题 I - 单变量数据缺失值管理 II compares the missing values dataset and refill the missing value with imputeTS::na.seadec():

  • interpolation
  • kalman
  • locf
  • ma
  • mean
  • random

The papers concludes that the imputeTS::na.seadec(algorithm = 'interpolation') or imputeTS::na.seadec(algorithm = 'kalman') repaired dataset no matter how much of portion of missing value is workable since the MSE and bias is very low. The Amelia::amelia is accurate and the bias and imprecision is small compare to imputeTS::sea.dec when the portion of missing value is small. The papers compare tick-data-to-1min-data and also 1min-data where both datasets gather from FXCM. It is very weird that the tidyr::fill and na.locf both are not too accurate. However, in this paper I use tidy::fill() method to fill the missing value, it will similar with kalman filter method since it will filled up the missing value ascending to fill up with direction down until the bottom of the dataset and then fill up with direction up by descending to fill up initial missing value or top. It will not occured standard error bias like open or close price higher than highest price or lower than lowest price. Moreover, the filled price will not bias a lot from the trend as time goes by.

## tick-data to minute 1 dataset
#tsz <- read_rds('C:/Users/scibr/Documents/GitHub/scibrokes/real-time-fxcm/data/USDJPY/tsz.rds')
tsz %>% dplyr::count(diff) %>% 
  kable(caption = 'Count data point') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Count data point
diff n
1228 mins 1
1276 mins 1
1657 mins 1
2407 mins 1
2449 mins 1
2650 mins 1
2834 mins 1
3777 mins 1
5251 mins 1
5395 mins 1
5495 mins 1
5521 mins 1
5522 mins 1
5620 mins 1
5638 mins 2
5763 mins 2
6355 mins 1
6831 mins 1
6896 mins 1
7180 mins 1
7181 mins 1
7187 mins 1
7190 mins 1
7192 mins 1
7193 mins 1
7194 mins 7
7195 mins 8
7196 mins 9
7197 mins 8
7198 mins 41
7199 mins 84
NA mins 184
## minute 1 dataset
#tsz2 <- read_rds('C:/Users/scibr/Documents/GitHub/scibrokes/real-time-fxcm/data/USDJPY/tsz2.rds')
tsz2 %>% dplyr::count(diff) %>% 
  kable(caption = 'Count data point') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Count data point
diff n
5395 mins 1
5521 mins 1
5522 mins 1
5638 mins 2
5759 mins 1
7180 mins 1
7187 mins 1
7190 mins 1
7192 mins 1
7193 mins 1
7194 mins 7
7195 mins 10
7196 mins 13
7197 mins 10
7198 mins 47
7199 mins 85
NA mins 182

Above tables show both datasets are incompleted. However, when I tried to check the Y2017W20 and Y2017W20_m1, the tick-dataset only start from 2017-05-15 until 2017-05-17 but the m1-dataset from 2017-05-15 until 2017-05-19. Kindly refer to below comparison.

mean(tsz$diff, na.rm=TRUE)
## Time difference of 6886.853 mins
mean(tsz2$diff, na.rm=TRUE)
## Time difference of 7144.601 mins

From above comparison, we know the dataset of 1min is better compelete than tick-to-1min dataset.

#left_join(tsz[c(1, ncol(tsz))], tsz2[c(1, ncol(tsz2))])
right_join(tsz[c(1, ncol(tsz))], tsz2[c(1, ncol(tsz2))])
## # A tibble: 365 x 2
##    index               diff     
##    <dttm>              <drtn>   
##  1 2015-01-09 23:59:00 7199 mins
##  2 2015-01-12 00:00:00   NA mins
##  3 2015-01-16 23:56:00 7196 mins
##  4 2015-01-19 00:00:00   NA mins
##  5 2015-01-23 23:58:00 7198 mins
##  6 2015-01-26 00:00:00   NA mins
##  7 2015-01-30 23:58:00 7198 mins
##  8 2015-02-02 00:00:00   NA mins
##  9 2015-02-06 23:59:00 7199 mins
## 10 2015-02-09 00:00:00   NA mins
## # ... with 355 more rows

Here I compare the mean and get to know the downloaded min1 dataset from FXCM is better than downloaded tick-dataset (converted to min1) from FXCM.

# -------- eval=FALSE -----------
## tick-data to min-1 dataset
data_tm1 <- llply(fls[[7]], function(x) {
    y <- read_rds(x) %>% 
      convertOHLC(combine = TRUE)
    
    yw <- x %>% 
      str_extract_all('Y[0-9]{4}W[0-9]{1,2}') %>% 
      str_split_fixed('[A-Z]{1}', 3) %>% 
      .[,-1]
    y %<>% mutate(
      year = as.numeric(yw[1]), week = as.numeric(yw[2]), .)
    }) %>% 
  bind_rows %>% 
  as_tibble %>% 
  arrange(index)


## min-1 dataset
data_m1 <- llply(fls1[[5]], function(x) {
    y <- read_rds(x) %>% 
      dplyr::rename(index = DateTime) %>% 
      mutate(index = index %>% mdy_hms %>% 
               .POSIXct(tz = 'Europe/Athens') %>% 
               force_tz())
    
    yw <- x %>% str_extract_all('Y[0-9]{4}W[0-9]{1,2}') %>% 
      str_split_fixed('[A-Z]{1}', 3) %>% .[,-1]
    
    nch <- y$index[1] %>% substr(nchar(.)+2, nchar(.)+3)
    y %<>% mutate(
      year = as.numeric(yw[1]), week = as.numeric(yw[2]), 
      nch = nch, index = if_else(
        nch == '23', index + hours(1), index)) %>% 
      dplyr::select(-nch)
    }) %>% 
  bind_rows %>% 
  as_tibble %>% 
  arrange(index)
# -------- eval=FALSE -----------
#dtm <- seq(ymd_hms('2015-01-01 00:00:00'), ymd_hms('2017-08-31 00:00:00'), by = 'minutes')
#dtm <- seq(from = ymd('2015-01-05'), to = ymd('2018-07-07'), by = 'weeks')
dtm <- data_tm1 %>% 
  dplyr::select(index, year ,week) %>% 
  mutate(index = date(index)) %>% 
  ddply(.(year, week), head, 1) %>% 
  .[-nrow(.),]

## create a seq of datetime to complete the  data point.
dttm <- llply(1:nrow(dtm), function(i) {
  x1 <- dtm$index[i] %>% 
    as.POSIXct %>% 
    with_tz(tz = 'UTC') %>% 
    force_tz()
  
  #x2 <- x1 + days(4) + hours(23) + minutes(59)
  x2 <- x1 + days(5)
  
  data_frame(index = seq.POSIXt(from = x1 + minutes(1), to = x2, by = '1 min'), 
             year = dtm[i,2], week = dtm[i,3])
  }) %>% 
  bind_rows %>% 
  as_tibble

Above chunk created a sequence of datetime.

## merge dataset
data_m1 <- left_join(dttm, data_m1) %>% 
  as_tibble %>% 
  unique %>% 
  arrange(index)

data_tm1 <- left_join(dttm, data_tm1) %>% 
  as_tibble %>% 
  unique %>% 
  arrange(index)

## https://stackoverflow.com/questions/43212308/na-locf-using-group-by-from-dplyr
## https://stackoverflow.com/questions/233401., eval.expr = TRUE) : 
  Scanner error: mapping values50/replace-missing-values-na-with-most-recent-non-na-by-group
## https://stackoverflow.com/questions/40040834/replace-na-with-previous-or-next-value-by-group-using-dplyr/40041172
## https://stackoverflow.com/questions/47242643/na-at-the-end-of-column-using-na-locf-function
## https://stackoverflow.com/questions/49578085/na-locf-function-is-changing-data-frame-values-from-int-to-char-in-r
## https://stackoverflow.com/questions/13616965/how-to-fill-nas-with-locf-by-factors-in-data-frame-split-by-country
## https://stackoverflow.com/questions/23340150/replace-missing-values-na-with-most-recent-non-na-by-group

# data_m1 %>% 
#     group_by(index, week) %>% 
#     mutate_all(funs(na.locf(., na.rm = FALSE)))

# data_m1 %>% split(data_m1$index) %>% 
#   llply(function(x) {
#     na.locf(na.locf(x), fromLast = TRUE)
#   }) %>% do.call(rbind, .)

# data_m1 %<>% ddply(.(index, week), na_locf) %>% as_tibble
#> data_m1 %>% anyNA
#[1] FALSE

data_m1 %<>% 
  ddply(.(year, week), function(x) {
       x %>% fill(year, week, BidOpen, BidHigh, BidLow, BidClose, 
                  AskOpen, AskHigh, AskLow, AskClose) %>% #default direction down
             fill(year, week, BidOpen, BidHigh, BidLow, BidClose, 
                  AskOpen, AskHigh, AskLow, AskClose, .direction = 'up')
    }) %>% 
  as_tibble

data_tm1 %<>% 
  ddply(.(year, week), function(x) {
       x %>% fill(year, week, BidOpen, BidHigh, BidLow, BidClose, 
                  AskOpen, AskHigh, AskLow, AskClose) %>% #default direction down
             fill(year, week, BidOpen, BidHigh, BidLow, BidClose, 
                  AskOpen, AskHigh, AskLow, AskClose, .direction = 'up')
    }) %>% 
  as_tibble
#> data_m1 %>% anyNA
#[1] TRUE
#> data_m1 %>% filter_all(any_vars(is.na(.)))
## A tibble: 7,200 x 11
#   index                year  week BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow AskClose
#   <dttm>              <dbl> <dbl>   <dbl>   <dbl>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>    <dbl>
# 1 2018-01-02 00:01:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 2 2018-01-02 00:02:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 3 2018-01-02 00:03:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 4 2018-01-02 00:04:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 5 2018-01-02 00:05:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 6 2018-01-02 00:06:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 7 2018-01-02 00:07:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 8 2018-01-02 00:08:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
# 9 2018-01-02 00:09:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
#10 2018-01-02 00:10:00  2017    53      NA      NA     NA       NA      NA      NA     NA       NA
## ... with 7,190 more rows

#> data_tm1 %>% anyNA
#[1] FALSE
#> data_tm1 %>% filter_all(any_vars(is.na(.)))
## A tibble: 0 x 11
## ... with 11 variables: index <dttm>, year <dbl>, week <dbl>, AskOpen <dbl>, AskHigh <dbl>, AskLow <dbl>,
##   AskClose <dbl>, BidOpen <dbl>, BidHigh <dbl>, BidLow <dbl>, BidClose <dbl>

saveRDS(data_m1, paste0(dtr1, '/data_m1.rds'))
saveRDS(data_tm1, paste0(dtr1, '/data_tm1.rds'))

I don’t use the data.table and feather because of the storage concerns. Kindly refer to [问答] 对大数据如何用R高效处理[问答] 对大数据如何用R高效处理.

Finally, I filled-up the NA section of data_m1 and data_tm1 and eventually filled up by tidyr::fill function.

3.3.2 Read Data

Due to the files preload all before simulate the statistical modelling will occupy the space. Here I directly read the files and simulate the algorithmic prediction in following sections.

rm(list = ls()[grep('i|j|tz|nch|yw|dtm|dttm|form|data|Y2015W|tsz|tsz2|dc', ls())])

cr_code <- c('AUDUSD=X', 'EURUSD=X', 'GBPUSD=X', 'CHF=X', 'CAD=X', 'CNY=X', 'JPY=X')

names(cr_code) <- c('AUDUSD', 'EURUSD', 'GBPUSD', 'USDCHF', 'USDCAD', 'USDCNY', 'USDJPY')

data_m1 <- read_rds(paste0(dtr1s, '/data_m1.rds'))

tb1 <- data_m1 %>% ddply(.(year, week), head, 1) %>% 
  kbl('html', caption = 'Weekly Initial Data Point', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')

tb1
Weekly Initial Data Point
index year week BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow AskClose
2015-01-05 00:01:00 2015 1 120.502 120.570 120.484 120.538 120.608 120.671 120.566 120.610
2015-01-12 00:01:00 2015 2 118.222 118.280 118.214 118.262 118.276 118.312 118.258 118.282
2015-01-19 00:01:00 2015 3 117.442 117.442 117.402 117.432 117.478 117.550 117.478 117.512
2015-01-26 00:01:00 2015 4 117.500 117.504 117.467 117.482 117.508 117.524 117.502 117.507
2015-02-02 00:01:00 2015 5 116.979 117.048 116.971 117.046 117.011 117.067 116.983 117.065
2015-02-09 00:01:00 2015 6 119.028 119.046 119.000 119.046 119.081 119.150 119.042 119.052
2015-02-16 00:01:00 2015 7 118.562 118.628 118.544 118.628 118.587 118.649 118.548 118.646
2015-02-23 00:01:00 2015 8 119.094 119.094 119.061 119.061 119.149 119.149 119.109 119.109
2015-03-02 00:01:00 2015 9 119.688 119.716 119.673 119.716 119.760 119.764 119.714 119.748
2015-03-09 00:01:00 2015 10 120.800 120.836 120.800 120.836 120.920 120.920 120.889 120.889
2015-03-16 00:01:00 2015 11 121.374 121.382 121.346 121.346 121.430 121.436 121.410 121.410
2015-03-23 00:01:00 2015 12 119.884 119.894 119.868 119.890 119.900 119.902 119.897 119.898
2015-03-30 00:01:00 2015 13 119.216 119.220 119.203 119.203 119.247 119.253 119.230 119.230
2015-04-06 00:01:00 2015 14 118.845 118.845 118.839 118.839 118.915 118.951 118.915 118.943
2015-04-13 00:01:00 2015 15 120.299 120.311 120.299 120.311 120.385 120.386 120.368 120.368
2015-04-20 00:01:00 2015 16 118.985 118.993 118.985 118.993 119.014 119.047 119.014 119.047
2015-04-27 00:01:00 2015 17 118.864 118.877 118.864 118.876 118.906 118.906 118.903 118.903
2015-05-04 00:01:00 2015 18 120.227 120.227 120.226 120.226 120.242 120.242 120.242 120.242
2015-05-11 00:01:00 2015 19 119.652 119.688 119.644 119.658 119.684 119.731 119.676 119.719
2015-05-18 00:01:00 2015 20 119.214 119.255 119.214 119.255 119.308 119.314 119.308 119.312
2015-05-25 00:01:00 2015 21 121.494 121.494 121.488 121.488 121.516 121.516 121.512 121.512
2015-06-01 00:01:00 2015 22 124.076 124.084 124.072 124.072 124.100 124.106 124.094 124.096
2015-06-08 00:01:00 2015 23 125.578 125.588 125.566 125.568 125.598 125.610 125.590 125.590
2015-06-15 00:01:00 2015 24 123.174 123.174 123.130 123.159 123.276 123.276 123.186 123.189
2015-06-22 00:01:00 2015 25 122.955 122.957 122.922 122.922 122.968 122.968 122.936 122.936
2015-06-29 00:01:00 2015 26 122.728 122.736 122.667 122.707 122.740 122.806 122.692 122.740
2015-07-06 00:01:00 2015 27 121.968 122.004 121.951 121.986 121.992 122.128 121.978 122.002
2015-07-13 00:01:00 2015 28 122.218 122.224 122.178 122.204 122.332 122.332 122.206 122.286
2015-07-20 00:01:00 2015 29 124.044 124.044 124.036 124.036 124.058 124.058 124.048 124.048
2015-07-27 00:01:00 2015 30 123.728 123.760 123.726 123.760 123.800 123.830 123.770 123.830
2015-08-03 00:01:00 2015 31 123.850 123.860 123.850 123.860 123.904 123.906 123.904 123.906
2015-08-10 00:01:00 2015 32 124.140 124.140 124.127 124.127 124.204 124.204 124.204 124.204
2015-08-17 00:01:00 2015 33 124.228 124.268 124.228 124.255 124.356 124.372 124.352 124.363
2015-08-24 00:01:00 2015 34 121.882 121.894 121.882 121.890 121.902 121.920 121.902 121.918
2015-08-31 00:01:00 2015 35 121.576 121.622 121.576 121.616 121.682 121.686 121.624 121.632
2015-09-07 00:01:00 2015 36 118.864 118.906 118.864 118.874 118.918 118.926 118.914 118.918
2015-09-14 00:01:00 2015 37 120.488 120.489 120.472 120.472 120.602 120.603 120.596 120.596
2015-09-21 00:01:00 2015 38 120.104 120.112 120.102 120.102 120.136 120.144 120.134 120.136
2015-09-28 00:01:00 2015 39 120.510 120.510 120.502 120.502 120.536 120.543 120.536 120.543
2015-10-05 00:01:00 2015 40 119.982 119.987 119.968 119.986 120.008 120.072 120.008 120.070
2015-10-12 00:01:00 2015 41 120.166 120.166 120.162 120.164 120.199 120.202 120.194 120.199
2015-10-19 00:01:00 2015 42 119.351 119.351 119.346 119.346 119.429 119.434 119.429 119.434
2015-10-26 00:01:00 2015 43 121.450 121.468 121.448 121.454 121.518 121.520 121.470 121.470
2015-11-02 00:01:00 2015 44 120.450 120.462 120.392 120.396 120.479 120.483 120.402 120.430
2015-11-09 00:01:00 2015 45 123.254 123.302 123.254 123.302 123.362 123.362 123.319 123.319
2015-11-16 00:01:00 2015 46 122.286 122.310 122.280 122.293 122.299 122.350 122.295 122.301
2015-11-23 00:01:00 2015 47 122.801 122.821 122.801 122.816 122.920 122.925 122.919 122.924
2015-11-30 00:01:00 2015 48 122.810 122.811 122.810 122.811 122.829 122.830 122.829 122.830
2015-12-07 00:01:00 2015 49 123.191 123.191 123.190 123.190 123.240 123.240 123.239 123.239
2015-12-14 00:01:00 2015 50 121.138 121.147 120.965 121.100 121.158 121.158 121.045 121.110
2015-12-21 00:01:00 2015 51 121.226 121.226 121.226 121.226 121.258 121.260 121.258 121.260
2015-12-28 00:01:00 2015 52 120.230 120.270 120.216 120.223 120.328 120.330 120.260 120.328
2016-01-04 00:01:00 2016 1 120.199 120.205 120.199 120.205 120.241 120.241 120.234 120.235
2016-01-11 00:01:00 2016 2 117.139 117.164 117.131 117.164 117.158 117.228 117.145 117.200
2016-01-18 00:01:00 2016 3 116.699 116.834 116.682 116.828 116.752 116.882 116.750 116.872
2016-01-25 00:01:00 2016 4 118.620 118.689 118.620 118.689 118.701 118.780 118.700 118.707
2016-02-01 00:01:00 2016 5 121.298 121.298 121.198 121.258 121.325 121.325 121.244 121.277
2016-02-08 00:01:00 2016 6 116.779 116.799 116.779 116.799 116.877 116.899 116.877 116.899
2016-02-15 00:01:00 2016 7 113.382 113.382 113.376 113.382 113.418 113.419 113.418 113.418
2016-02-22 00:01:00 2016 8 112.558 112.560 112.536 112.536 112.618 112.624 112.616 112.624
2016-02-29 00:01:00 2016 9 113.942 113.948 113.940 113.946 113.994 113.999 113.992 113.998
2016-03-07 00:01:00 2016 10 113.918 113.918 113.913 113.913 113.982 113.982 113.982 113.982
2016-03-14 00:01:00 2016 11 113.935 113.936 113.924 113.924 113.962 113.968 113.956 113.958
2016-03-21 00:01:00 2016 12 111.518 111.518 111.512 111.512 111.612 111.612 111.602 111.602
2016-03-28 00:01:00 2016 13 113.156 113.156 113.149 113.149 113.234 113.240 113.234 113.240
2016-04-04 00:01:00 2016 14 111.590 111.594 111.590 111.590 111.658 111.662 111.658 111.660
2016-04-11 00:01:00 2016 15 107.932 107.992 107.932 107.992 108.006 108.066 108.006 108.020
2016-04-18 00:01:00 2016 16 108.173 108.220 108.173 108.188 108.252 108.284 108.252 108.274
2016-04-25 00:01:00 2016 17 111.846 111.848 111.844 111.848 111.882 111.892 111.882 111.892
2016-05-02 00:01:00 2016 18 106.230 106.254 106.216 106.244 106.274 106.310 106.273 106.280
2016-05-09 00:01:00 2016 19 107.068 107.068 107.066 107.067 107.106 107.108 107.106 107.108
2016-05-16 00:01:00 2016 20 108.592 108.595 108.589 108.595 108.654 108.674 108.654 108.670
2016-05-23 00:01:00 2016 21 110.138 110.138 110.134 110.136 110.176 110.176 110.172 110.172
2016-05-30 00:01:00 2016 22 110.414 110.428 110.410 110.428 110.432 110.456 110.432 110.451
2016-06-06 00:01:00 2016 23 106.549 106.555 106.547 106.555 106.575 106.575 106.573 106.575
2016-06-13 00:01:00 2016 24 106.800 106.833 106.796 106.812 106.890 106.892 106.884 106.884
2016-06-20 00:01:00 2016 25 104.681 104.692 104.657 104.671 104.739 104.744 104.723 104.743
2016-06-27 00:01:00 2016 26 101.519 101.521 101.510 101.519 101.539 101.550 101.527 101.546
2016-07-04 00:01:00 2016 27 102.594 102.598 102.594 102.598 102.636 102.647 102.634 102.647
2016-07-11 00:01:00 2016 28 100.589 100.590 100.589 100.590 100.653 100.653 100.653 100.653
2016-07-18 00:01:00 2016 29 105.333 105.342 105.331 105.342 105.369 105.369 105.368 105.368
2016-07-25 00:01:00 2016 30 106.116 106.129 106.089 106.089 106.180 106.186 106.175 106.176
2016-08-01 00:01:00 2016 31 102.284 102.284 102.205 102.234 102.376 102.376 102.274 102.284
2016-08-08 00:01:00 2016 32 101.937 101.946 101.937 101.944 101.996 102.012 101.964 102.012
2016-08-15 00:01:00 2016 33 101.115 101.124 101.115 101.124 101.157 101.206 101.157 101.206
2016-08-22 00:01:00 2016 34 100.748 100.748 100.746 100.748 100.811 100.811 100.784 100.784
2016-08-29 00:01:00 2016 35 102.039 102.096 102.026 102.076 102.116 102.122 102.052 102.102
2016-09-05 00:01:00 2016 36 104.078 104.084 104.078 104.078 104.146 104.146 104.146 104.146
2016-09-12 00:01:00 2016 37 102.552 102.588 102.552 102.571 102.650 102.651 102.650 102.651
2016-09-19 00:01:00 2016 38 102.148 102.178 102.148 102.178 102.246 102.266 102.204 102.220
2016-09-26 00:01:00 2016 39 101.029 101.059 101.029 101.038 101.079 101.135 101.079 101.132
2016-10-03 00:01:00 2016 40 101.196 101.198 101.194 101.198 101.276 101.284 101.276 101.284
2016-10-10 00:01:00 2016 41 103.292 103.296 103.242 103.252 103.374 103.374 103.299 103.299
2016-10-17 00:01:00 2016 42 104.327 104.327 104.317 104.326 104.340 104.344 104.340 104.340
2016-10-24 00:01:00 2016 43 103.816 103.820 103.816 103.820 103.873 103.873 103.873 103.873
2016-10-31 00:01:00 2016 44 104.404 104.412 104.401 104.411 104.502 104.502 104.489 104.493
2016-11-07 00:01:00 2016 45 104.033 104.033 103.769 103.769 104.117 104.117 103.829 103.829
2016-11-14 00:01:00 2016 46 106.848 106.848 106.767 106.812 106.880 106.880 106.792 106.822
2016-11-21 00:01:00 2016 47 110.898 110.980 110.898 110.958 110.982 110.995 110.980 110.986
2016-11-28 00:01:00 2016 48 112.798 112.872 112.798 112.872 112.872 112.902 112.872 112.902
2016-12-05 00:01:00 2016 49 113.223 113.248 113.176 113.182 113.372 113.372 113.186 113.196
2016-12-12 00:01:00 2016 50 115.403 115.412 115.403 115.408 115.452 115.452 115.437 115.452
2016-12-19 00:01:00 2016 51 117.948 117.948 117.948 117.948 117.972 117.972 117.956 117.972
2016-12-27 00:01:00 2016 52 117.242 117.242 117.189 117.195 117.322 117.322 117.195 117.198
2017-01-03 00:01:00 2017 1 116.978 117.523 116.978 117.454 117.076 117.528 117.076 117.453
2017-01-09 00:01:00 2017 2 117.009 117.009 117.002 117.002 117.031 117.031 117.012 117.012
2017-01-16 00:01:00 2017 3 114.299 114.378 114.299 114.309 114.381 114.392 114.381 114.391
2017-01-23 00:01:00 2017 4 114.354 114.364 114.338 114.348 114.400 114.430 114.392 114.420
2017-01-30 00:01:00 2017 5 114.760 114.800 114.760 114.784 114.790 114.820 114.784 114.820
2017-02-06 00:01:00 2017 6 112.442 112.455 112.440 112.444 112.520 112.520 112.480 112.480
2017-02-13 00:01:00 2017 7 113.545 113.545 113.530 113.530 113.625 113.625 113.625 113.625
2017-02-20 00:01:00 2017 8 112.864 112.882 112.864 112.879 112.903 112.908 112.903 112.908
2017-02-27 00:01:00 2017 9 112.108 112.125 112.108 112.125 112.192 112.205 112.192 112.204
2017-03-06 00:01:00 2017 10 113.855 113.894 113.855 113.894 113.903 113.916 113.903 113.913
2017-03-13 00:01:00 2017 11 114.725 114.725 114.689 114.707 114.784 114.787 114.743 114.784
2017-03-20 00:01:00 2017 12 112.656 112.681 112.656 112.673 112.749 112.757 112.749 112.757
2017-03-27 00:01:00 2017 13 110.861 110.893 110.815 110.893 110.917 110.975 110.898 110.935
2017-04-03 00:01:00 2017 14 111.414 111.414 111.329 111.329 111.503 111.503 111.418 111.418
2017-04-10 00:01:00 2017 15 111.029 111.066 111.015 111.018 111.118 111.118 111.081 111.081
2017-04-17 00:01:00 2017 16 108.691 108.741 108.691 108.741 108.790 108.830 108.790 108.830
2017-04-24 00:01:00 2017 17 110.518 110.518 110.394 110.457 110.729 110.729 110.502 110.516
2017-05-01 00:01:00 2017 18 111.240 111.330 111.240 111.330 111.334 111.394 111.334 111.389
2017-05-08 00:01:00 2017 19 112.931 112.949 112.922 112.946 113.004 113.022 112.980 112.984
2017-05-15 00:01:00 2017 20 113.124 113.171 113.124 113.170 113.205 113.205 113.194 113.194
2017-05-22 00:01:00 2017 21 110.985 111.050 110.985 111.047 111.084 111.084 111.069 111.069
2017-05-29 00:01:00 2017 22 111.178 111.210 111.178 111.210 111.277 111.309 111.277 111.309
2017-06-05 00:01:00 2017 23 110.352 110.391 110.352 110.391 110.396 110.483 110.396 110.480
2017-06-12 00:01:00 2017 24 110.309 110.309 110.291 110.304 110.342 110.342 110.333 110.333
2017-06-19 00:01:00 2017 25 110.881 110.881 110.878 110.878 110.945 110.945 110.922 110.924
2017-06-26 00:01:00 2017 26 111.186 111.186 111.178 111.184 111.256 111.256 111.235 111.235
2017-07-03 00:01:00 2017 27 112.098 112.125 112.085 112.125 112.122 112.179 112.122 112.176
2017-07-10 00:01:00 2017 28 113.863 113.899 113.863 113.899 113.897 113.918 113.897 113.918
2017-07-17 00:01:00 2017 29 112.452 112.480 112.452 112.480 112.485 112.515 112.485 112.504
2017-07-24 00:01:00 2017 30 111.106 111.106 111.097 111.106 111.138 111.138 111.133 111.133
2017-07-31 00:01:00 2017 31 110.653 110.653 110.636 110.636 110.677 110.677 110.668 110.668
2017-08-07 00:01:00 2017 32 110.697 110.702 110.686 110.702 110.727 110.745 110.726 110.738
2017-08-14 00:01:00 2017 33 109.153 109.153 109.153 109.153 109.187 109.187 109.184 109.184
2017-08-21 00:01:00 2017 34 109.313 109.346 109.313 109.346 109.347 109.377 109.347 109.377
2017-08-28 00:01:00 2017 35 109.154 109.176 109.154 109.176 109.223 109.223 109.206 109.206
2017-09-04 00:01:00 2017 36 109.532 109.556 109.528 109.532 109.558 109.592 109.554 109.566
2017-09-11 00:01:00 2017 37 108.196 108.196 108.188 108.190 108.212 108.246 108.206 108.230
2017-09-18 00:01:00 2017 38 111.042 111.060 111.040 111.060 111.094 111.094 111.094 111.094
2017-09-25 00:01:00 2017 39 112.146 112.161 112.146 112.148 112.202 112.202 112.178 112.182
2017-10-02 00:01:00 2017 40 112.538 112.538 112.538 112.538 112.606 112.608 112.606 112.608
2017-10-09 00:01:00 2017 41 112.570 112.570 112.550 112.569 112.622 112.622 112.600 112.600
2017-10-16 00:01:00 2017 42 111.748 111.786 111.748 111.784 111.782 111.806 111.782 111.800
2017-10-23 00:01:00 2017 43 113.868 113.872 113.844 113.846 113.896 113.896 113.878 113.878
2017-10-30 00:01:00 2017 44 113.718 113.723 113.718 113.723 113.746 113.746 113.741 113.741
2017-11-06 00:01:00 2017 45 114.001 114.015 114.001 114.015 114.049 114.049 114.035 114.048
2017-11-13 00:01:00 2017 46 113.492 113.538 113.492 113.494 113.572 113.574 113.544 113.546
2017-11-20 00:01:00 2017 47 112.120 112.120 112.119 112.119 112.168 112.168 112.167 112.167
2017-11-27 00:01:00 2017 48 111.500 111.501 111.500 111.500 111.548 111.549 111.548 111.548
2017-12-04 00:01:00 2017 49 112.776 112.778 112.707 112.726 112.792 112.800 112.750 112.774
2017-12-11 00:01:00 2017 50 113.526 113.528 113.526 113.528 113.566 113.566 113.562 113.562
2017-12-18 00:01:00 2017 51 112.714 112.717 112.714 112.717 112.734 112.734 112.734 112.734
2017-12-26 00:01:00 2017 52 113.265 113.287 113.265 113.287 113.343 113.343 113.287 113.289
2018-01-02 00:01:00 2017 53 NA NA NA NA NA NA NA NA
2018-01-02 00:01:00 2018 1 112.596 112.601 112.596 112.601 112.650 112.658 112.650 112.658
2018-01-08 00:01:00 2018 2 113.116 113.121 113.116 113.121 113.152 113.152 113.150 113.152
2018-01-15 00:01:00 2018 3 111.075 111.082 111.075 111.081 111.113 111.113 111.104 111.104
2018-01-22 00:01:00 2018 4 110.543 110.543 110.517 110.517 110.602 110.602 110.570 110.570
2018-01-29 00:01:00 2018 5 108.685 108.700 108.684 108.693 108.733 108.746 108.732 108.732
2018-02-05 00:01:00 2018 6 110.200 110.206 110.172 110.172 110.248 110.248 110.228 110.232
2018-02-12 00:01:00 2018 7 108.858 108.862 108.832 108.836 108.896 108.898 108.858 108.858
2018-02-19 00:01:00 2018 8 106.328 106.328 106.298 106.304 106.382 106.382 106.348 106.348
2018-02-26 00:01:00 2018 9 107.106 107.116 107.092 107.092 107.132 107.132 107.114 107.114
2018-03-05 00:01:00 2018 10 105.500 105.500 105.494 105.496 105.554 105.556 105.552 105.552
2018-03-12 00:01:00 2018 11 106.635 106.642 106.635 106.642 106.673 106.680 106.673 106.680
2018-03-19 00:01:00 2018 12 105.915 105.917 105.904 105.915 105.926 105.949 105.916 105.942
2018-03-26 00:01:00 2018 13 104.641 104.642 104.640 104.642 104.694 104.695 104.678 104.695
2018-04-02 00:01:00 2018 14 106.260 106.260 106.237 106.237 106.312 106.312 106.273 106.274
2018-04-09 00:01:00 2018 15 106.937 106.944 106.937 106.944 106.989 106.992 106.989 106.992
2018-04-16 00:01:00 2018 16 107.338 107.470 107.338 107.462 107.385 107.525 107.385 107.510
2018-04-23 00:01:00 2018 17 107.766 107.770 107.762 107.770 107.816 107.816 107.816 107.816
2018-04-30 00:01:00 2018 18 109.055 109.066 109.020 109.066 109.083 109.091 109.046 109.089
2018-05-07 00:01:00 2018 19 109.109 109.109 109.108 109.108 109.127 109.127 109.126 109.126
2018-05-14 00:01:00 2018 20 109.384 109.384 109.335 109.346 109.443 109.443 109.389 109.394
2018-05-21 00:01:00 2018 21 110.869 110.900 110.866 110.866 110.897 110.917 110.894 110.909
2018-05-28 00:01:00 2018 22 109.738 109.746 109.702 109.740 109.750 109.762 109.745 109.760
2018-06-04 00:01:00 2018 23 109.454 109.454 109.450 109.450 109.480 109.480 109.456 109.456
2018-06-11 00:01:00 2018 24 109.284 109.296 109.284 109.292 109.324 109.350 109.324 109.350
2018-06-18 00:01:00 2018 25 110.665 110.676 110.665 110.665 110.700 110.719 110.700 110.718
2018-06-25 00:01:00 2018 26 109.841 109.847 109.841 109.847 109.889 109.895 109.884 109.895
2018-07-02 00:01:00 2018 27 110.680 110.680 110.667 110.667 110.720 110.726 110.720 110.726
tb2 <- data_m1 %>% ddply(.(year, week), tail, 1) %>% 
  kbl('html', caption = 'Weekly Final Data Point', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')

tb2
Weekly Final Data Point
index year week BidOpen BidHigh BidLow BidClose AskOpen AskHigh AskLow AskClose
2015-01-10 2015 1 118.522 118.522 118.495 118.495 118.556 118.601 118.556 118.601
2015-01-17 2015 2 117.462 117.554 117.461 117.548 117.490 117.669 117.482 117.669
2015-01-24 2015 3 117.724 117.770 117.714 117.732 117.834 117.836 117.796 117.816
2015-01-31 2015 4 117.493 117.534 117.438 117.528 117.548 117.614 117.548 117.576
2015-02-07 2015 5 119.134 119.134 119.090 119.090 119.158 119.222 119.158 119.222
2015-02-14 2015 6 118.719 118.719 118.696 118.696 118.919 118.944 118.919 118.944
2015-02-21 2015 7 119.050 119.056 118.966 119.010 119.098 119.116 119.036 119.042
2015-02-28 2015 8 119.596 119.636 119.576 119.576 119.620 119.710 119.618 119.704
2015-03-07 2015 9 120.784 120.784 120.708 120.708 120.804 120.885 120.804 120.885
2015-03-14 2015 10 121.426 121.428 121.350 121.416 121.448 121.496 121.388 121.458
2015-03-21 2015 11 120.048 120.052 120.008 120.018 120.072 120.100 120.056 120.068
2015-03-28 2015 12 119.112 119.112 119.109 119.109 119.150 119.171 119.150 119.171
2015-04-04 2015 13 118.929 118.929 118.928 118.928 119.016 119.041 119.016 119.041
2015-04-11 2015 14 120.170 120.174 120.170 120.174 120.206 120.261 120.206 120.261
2015-04-18 2015 15 118.889 118.897 118.889 118.897 118.971 118.978 118.971 118.978
2015-04-25 2015 16 118.906 118.930 118.906 118.926 118.974 119.020 118.974 119.015
2015-05-02 2015 17 120.202 120.202 120.171 120.171 120.256 120.256 120.251 120.251
2015-05-09 2015 18 119.754 119.771 119.754 119.771 119.806 119.870 119.806 119.870
2015-05-16 2015 19 119.366 119.366 119.352 119.359 119.418 119.467 119.418 119.450
2015-05-23 2015 20 121.544 121.544 121.500 121.500 121.576 121.591 121.576 121.581
2015-05-30 2015 21 124.130 124.130 124.112 124.112 124.154 124.191 124.154 124.191
2015-06-06 2015 22 125.577 125.588 125.575 125.576 125.638 125.667 125.638 125.655
2015-06-13 2015 23 123.359 123.359 123.349 123.349 123.446 123.471 123.446 123.471
2015-06-20 2015 24 122.672 122.672 122.632 122.632 122.724 122.725 122.711 122.711
2015-06-27 2015 25 123.884 123.884 123.809 123.809 123.912 123.926 123.901 123.901
2015-07-04 2015 26 122.854 122.854 122.799 122.799 122.914 122.934 122.888 122.901
2015-07-11 2015 27 122.721 122.844 122.654 122.792 122.780 122.893 122.780 122.893
2015-07-18 2015 28 124.075 124.088 124.020 124.054 124.103 124.126 124.070 124.078
2015-07-25 2015 29 123.800 123.800 123.769 123.769 123.832 123.856 123.832 123.848
2015-08-01 2015 30 123.875 123.875 123.836 123.836 123.944 123.944 123.944 123.944
2015-08-08 2015 31 124.211 124.213 124.202 124.202 124.228 124.233 124.224 124.224
2015-08-15 2015 32 124.315 124.316 124.314 124.314 124.337 124.340 124.337 124.340
2015-08-22 2015 33 122.052 122.052 122.023 122.023 122.064 122.106 122.064 122.106
2015-08-29 2015 34 121.736 121.736 121.682 121.696 121.750 121.788 121.750 121.775
2015-09-05 2015 35 119.030 119.030 119.009 119.026 119.036 119.055 119.029 119.055
2015-09-12 2015 36 120.582 120.582 120.574 120.574 120.595 120.595 120.587 120.587
2015-09-19 2015 37 119.942 119.959 119.919 119.955 119.991 120.046 119.991 120.036
2015-09-26 2015 38 120.574 120.574 120.544 120.544 120.610 120.645 120.610 120.623
2015-10-03 2015 39 119.860 119.875 119.860 119.875 119.945 119.954 119.945 119.954
2015-10-10 2015 40 120.208 120.208 120.189 120.189 120.244 120.278 120.244 120.278
2015-10-17 2015 41 119.436 119.436 119.407 119.407 119.476 119.498 119.476 119.489
2015-10-24 2015 42 121.422 121.422 121.419 121.419 121.498 121.501 121.498 121.501
2015-10-31 2015 43 120.594 120.594 120.584 120.584 120.630 120.666 120.630 120.666
2015-11-07 2015 44 123.128 123.169 123.117 123.119 123.199 123.226 123.199 123.226
2015-11-14 2015 45 122.576 122.579 122.564 122.579 122.655 122.658 122.646 122.658
2015-11-21 2015 46 122.768 122.768 122.752 122.752 122.810 122.831 122.810 122.831
2015-11-28 2015 47 122.722 122.812 122.722 122.812 122.849 122.894 122.849 122.888
2015-12-05 2015 48 123.113 123.113 123.088 123.088 123.128 123.144 123.126 123.126
2015-12-12 2015 49 120.950 120.956 120.929 120.929 120.988 121.001 120.988 120.990
2015-12-19 2015 50 121.138 121.138 121.099 121.099 121.176 121.193 121.176 121.181
2015-12-26 2015 51 120.273 120.274 120.269 120.269 120.281 120.281 120.279 120.279
2016-01-02 2015 52 120.206 120.222 120.184 120.191 120.212 120.237 120.212 120.225
2016-01-09 2016 1 117.226 117.226 117.198 117.201 117.281 117.291 117.281 117.283
2016-01-16 2016 2 116.969 116.969 116.954 116.954 117.070 117.071 117.070 117.071
2016-01-23 2016 3 118.760 118.760 118.737 118.744 118.788 118.826 118.788 118.826
2016-01-30 2016 4 121.115 121.120 121.030 121.119 121.135 121.140 121.110 121.139
2016-02-06 2016 5 116.824 116.824 116.791 116.798 116.870 116.918 116.838 116.840
2016-02-13 2016 6 113.200 113.208 113.144 113.170 113.221 113.276 113.200 113.248
2016-02-20 2016 7 112.551 112.556 112.539 112.539 112.581 112.596 112.562 112.596
2016-02-27 2016 8 113.962 113.964 113.959 113.964 113.991 113.994 113.991 113.994
2016-03-05 2016 9 113.757 113.774 113.740 113.774 113.776 113.834 113.774 113.820
2016-03-12 2016 10 113.814 113.846 113.788 113.790 113.845 113.878 113.834 113.876
2016-03-19 2016 11 111.532 111.544 111.516 111.542 111.561 111.592 111.548 111.582
2016-03-26 2016 12 113.016 113.029 113.016 113.029 113.110 113.118 113.110 113.118
2016-04-02 2016 13 111.600 111.600 111.599 111.599 111.638 111.666 111.638 111.666
2016-04-09 2016 14 108.062 108.062 108.020 108.048 108.102 108.116 108.102 108.104
2016-04-16 2016 15 108.776 108.776 108.738 108.744 108.790 108.798 108.774 108.780
2016-04-23 2016 16 111.791 111.804 111.780 111.788 111.818 111.842 111.798 111.804
2016-04-30 2016 17 106.314 106.338 106.283 106.283 106.369 106.392 106.332 106.376
2016-05-07 2016 18 107.049 107.110 107.031 107.100 107.124 107.144 107.084 107.116
2016-05-14 2016 19 108.634 108.634 108.601 108.601 108.654 108.690 108.654 108.689
2016-05-21 2016 20 110.126 110.146 110.084 110.098 110.156 110.176 110.140 110.174
2016-05-28 2016 21 110.220 110.220 110.187 110.187 110.256 110.284 110.256 110.284
2016-06-04 2016 22 106.536 106.544 106.506 106.538 106.554 106.598 106.546 106.554
2016-06-11 2016 23 106.922 106.924 106.912 106.916 106.952 106.958 106.946 106.950
2016-06-18 2016 24 104.111 104.111 104.069 104.083 104.207 104.207 104.166 104.166
2016-06-25 2016 25 102.149 102.199 102.149 102.199 102.371 102.441 102.371 102.441
2016-07-02 2016 26 102.551 102.551 102.464 102.464 102.562 102.562 102.528 102.530
2016-07-09 2016 27 100.569 100.569 100.569 100.569 100.592 100.611 100.592 100.611
2016-07-16 2016 28 104.839 104.839 104.784 104.804 104.902 104.919 104.848 104.898
2016-07-23 2016 29 106.030 106.030 105.999 106.012 106.084 106.110 106.076 106.090
2016-07-30 2016 30 102.024 102.024 102.010 102.010 102.100 102.100 102.080 102.080
2016-08-06 2016 31 101.819 101.819 101.784 101.792 101.856 101.882 101.848 101.872
2016-08-13 2016 32 101.266 101.268 101.266 101.268 101.346 101.348 101.346 101.348
2016-08-20 2016 33 100.174 100.187 100.174 100.174 100.239 100.245 100.239 100.245
2016-08-27 2016 34 101.820 101.820 101.759 101.759 101.857 101.857 101.856 101.856
2016-09-03 2016 35 103.980 104.016 103.874 103.874 104.051 104.051 103.967 103.967
2016-09-10 2016 36 102.690 102.690 102.644 102.644 102.731 102.731 102.726 102.726
2016-09-17 2016 37 102.259 102.259 102.234 102.244 102.285 102.328 102.285 102.316
2016-09-24 2016 38 100.987 100.987 100.987 100.987 101.046 101.081 101.046 101.081
2016-10-01 2016 39 101.269 101.279 101.269 101.279 101.360 101.372 101.360 101.372
2016-10-08 2016 40 102.887 102.896 102.877 102.896 102.906 102.948 102.900 102.948
2016-10-15 2016 41 104.178 104.183 104.178 104.183 104.217 104.218 104.217 104.218
2016-10-22 2016 42 103.820 103.824 103.820 103.822 103.836 103.875 103.836 103.838
2016-10-29 2016 43 104.710 104.710 104.665 104.665 104.720 104.755 104.720 104.755
2016-11-05 2016 44 103.072 103.099 103.049 103.099 103.124 103.149 103.124 103.146
2016-11-12 2016 45 106.615 106.638 106.590 106.590 106.658 106.659 106.647 106.652
2016-11-19 2016 46 110.922 110.922 110.859 110.859 110.934 110.951 110.920 110.951
2016-11-26 2016 47 112.942 113.204 112.942 113.163 113.040 113.258 113.040 113.254
2016-12-03 2016 48 113.489 113.489 113.489 113.489 113.532 113.551 113.532 113.551
2016-12-10 2016 49 115.177 115.177 115.159 115.159 115.238 115.242 115.238 115.242
2016-12-17 2016 50 117.990 117.990 117.905 117.905 118.009 118.011 117.972 117.976
2016-12-24 2016 51 117.277 117.277 117.238 117.242 117.372 117.372 117.314 117.322
2017-01-01 2016 52 116.994 117.004 116.978 116.978 117.083 117.096 117.076 117.076
2017-01-08 2017 1 116.928 116.928 116.899 116.899 116.944 116.958 116.941 116.947
2017-01-14 2017 2 114.447 114.506 114.427 114.427 114.511 114.536 114.511 114.518
2017-01-21 2017 3 114.569 114.569 114.569 114.569 114.640 114.665 114.640 114.665
2017-01-28 2017 4 115.060 115.076 115.059 115.068 115.110 115.126 115.102 115.120
2017-02-04 2017 5 112.564 112.570 112.542 112.552 112.572 112.606 112.568 112.581
2017-02-11 2017 6 113.212 113.243 113.202 113.222 113.279 113.317 113.275 113.308
2017-02-18 2017 7 112.885 112.900 112.878 112.896 112.899 112.922 112.899 112.916
2017-02-25 2017 8 112.130 112.164 112.103 112.145 112.190 112.219 112.187 112.193
2017-03-04 2017 9 114.013 114.034 113.995 114.023 114.057 114.104 114.057 114.061
2017-03-11 2017 10 114.799 114.813 114.763 114.778 114.876 114.883 114.828 114.836
2017-03-18 2017 11 112.702 112.710 112.678 112.682 112.738 112.763 112.719 112.733
2017-03-25 2017 12 111.248 111.314 111.222 111.312 111.291 111.366 111.273 111.357
2017-04-01 2017 13 111.372 111.378 111.346 111.363 111.401 111.419 111.397 111.408
2017-04-08 2017 14 111.085 111.085 111.054 111.054 111.118 111.139 111.118 111.139
2017-04-15 2017 15 108.585 108.592 108.560 108.565 108.681 108.687 108.629 108.641
2017-04-22 2017 16 109.008 109.008 108.951 108.951 109.084 109.084 109.049 109.049
2017-04-29 2017 17 111.512 111.512 111.510 111.510 111.537 111.537 111.537 111.537
2017-05-06 2017 18 112.687 112.687 112.618 112.638 112.776 112.776 112.701 112.728
2017-05-13 2017 19 113.335 113.335 113.335 113.335 113.360 113.362 113.360 113.362
2017-05-20 2017 20 111.271 111.271 111.241 111.262 111.293 111.300 111.280 111.281
2017-05-27 2017 21 111.312 111.320 111.304 111.309 111.336 111.345 111.323 111.323
2017-06-03 2017 22 110.428 110.460 110.422 110.438 110.441 110.468 110.439 110.453
2017-06-10 2017 23 110.321 110.321 110.316 110.316 110.334 110.351 110.334 110.351
2017-06-17 2017 24 110.864 110.869 110.861 110.865 110.881 110.892 110.878 110.882
2017-06-24 2017 25 111.284 111.290 111.283 111.290 111.298 111.307 111.298 111.307
2017-07-01 2017 26 112.399 112.399 112.376 112.376 112.430 112.450 112.430 112.450
2017-07-08 2017 27 113.904 113.904 113.900 113.904 113.922 113.922 113.917 113.921
2017-07-15 2017 28 112.527 112.527 112.515 112.515 112.544 112.557 112.544 112.557
2017-07-22 2017 29 111.134 111.134 111.115 111.121 111.147 111.148 111.133 111.134
2017-07-29 2017 30 110.698 110.705 110.680 110.699 110.710 110.726 110.709 110.710
2017-08-05 2017 31 110.677 110.684 110.675 110.682 110.692 110.698 110.688 110.696
2017-08-12 2017 32 109.149 109.172 109.147 109.172 109.162 109.215 109.159 109.193
2017-08-19 2017 33 109.189 109.201 109.169 109.199 109.207 109.221 109.203 109.212
2017-08-26 2017 34 109.322 109.322 109.320 109.322 109.364 109.364 109.362 109.364
2017-09-02 2017 35 110.234 110.236 110.228 110.228 110.276 110.282 110.276 110.280
2017-09-09 2017 36 107.838 107.838 107.832 107.836 107.860 107.864 107.856 107.858
2017-09-16 2017 37 110.828 110.830 110.828 110.830 110.860 110.862 110.860 110.862
2017-09-23 2017 38 111.992 111.992 111.990 111.990 112.000 112.000 112.000 112.000
2017-09-30 2017 39 112.499 112.499 112.460 112.464 112.529 112.562 112.524 112.562
2017-10-07 2017 40 112.606 112.608 112.600 112.600 112.682 112.686 112.682 112.686
2017-10-14 2017 41 111.834 111.834 111.826 111.826 111.876 111.880 111.876 111.878
2017-10-21 2017 42 113.516 113.518 113.503 113.508 113.536 113.557 113.534 113.551
2017-10-28 2017 43 113.660 113.662 113.635 113.635 113.704 113.715 113.702 113.715
2017-11-04 2017 44 114.048 114.048 114.042 114.042 114.087 114.091 114.085 114.085
2017-11-11 2017 45 113.522 113.522 113.505 113.505 113.542 113.564 113.542 113.548
2017-11-18 2017 46 112.130 112.142 112.085 112.085 112.166 112.188 112.150 112.164
2017-11-25 2017 47 111.502 111.502 111.492 111.501 111.545 111.545 111.535 111.544
2017-12-02 2017 48 112.164 112.164 112.162 112.164 112.216 112.216 112.216 112.216
2017-12-09 2017 49 113.464 113.466 113.444 113.448 113.474 113.504 113.474 113.498
2017-12-16 2017 50 112.584 112.590 112.578 112.581 112.654 112.660 112.648 112.657
2017-12-23 2017 51 113.254 113.265 113.254 113.265 113.328 113.343 113.328 113.343
2017-12-31 2017 52 112.660 112.660 112.643 112.651 112.700 112.729 112.700 112.729
2018-01-07 2017 53 NA NA NA NA NA NA NA NA
2018-01-07 2018 1 113.032 113.032 113.018 113.018 113.092 113.100 113.090 113.098
2018-01-13 2018 2 111.002 111.006 110.988 110.996 111.044 111.060 111.026 111.052
2018-01-20 2018 3 110.814 110.814 110.814 110.814 110.856 110.856 110.854 110.854
2018-01-27 2018 4 108.624 108.626 108.589 108.589 108.634 108.648 108.632 108.632
2018-02-03 2018 5 110.153 110.153 110.152 110.152 110.195 110.195 110.195 110.195
2018-02-10 2018 6 108.780 108.780 108.768 108.770 108.812 108.824 108.812 108.824
2018-02-17 2018 7 106.300 106.300 106.272 106.272 106.312 106.325 106.303 106.315
2018-02-24 2018 8 106.863 106.863 106.858 106.858 106.919 106.919 106.914 106.914
2018-03-03 2018 9 105.722 105.722 105.696 105.712 105.730 105.762 105.730 105.757
2018-03-10 2018 10 106.807 106.818 106.807 106.814 106.850 106.850 106.822 106.822
2018-03-17 2018 11 105.964 105.966 105.953 105.953 106.001 106.007 106.001 106.007
2018-03-24 2018 12 104.728 104.730 104.708 104.712 104.744 104.766 104.742 104.766
2018-03-31 2018 13 106.261 106.261 106.258 106.260 106.312 106.312 106.312 106.312
2018-04-07 2018 14 106.926 106.926 106.913 106.915 106.950 106.962 106.950 106.962
2018-04-14 2018 15 107.334 107.338 107.334 107.338 107.377 107.385 107.377 107.385
2018-04-21 2018 16 107.628 107.628 107.616 107.616 107.656 107.674 107.656 107.674
2018-04-28 2018 17 109.042 109.046 109.022 109.022 109.074 109.088 109.064 109.080
2018-05-05 2018 18 109.055 109.059 109.055 109.056 109.098 109.105 109.098 109.105
2018-05-12 2018 19 109.360 109.360 109.358 109.358 109.412 109.412 109.410 109.410
2018-05-19 2018 20 110.746 110.746 110.730 110.736 110.760 110.789 110.760 110.783
2018-05-26 2018 21 109.378 109.380 109.362 109.362 109.398 109.409 109.398 109.409
2018-06-02 2018 22 109.514 109.514 109.488 109.488 109.524 109.548 109.524 109.535
2018-06-09 2018 23 109.511 109.536 109.507 109.509 109.554 109.558 109.550 109.554
2018-06-16 2018 24 110.644 110.650 110.644 110.644 110.687 110.692 110.687 110.691
2018-06-23 2018 25 109.982 109.984 109.976 109.976 109.992 109.994 109.984 109.984
2018-06-30 2018 26 110.678 110.678 110.666 110.666 110.698 110.708 110.698 110.708
2018-07-07 2018 27 110.450 110.454 110.446 110.449 110.477 110.499 110.477 110.499
## Tidy dataset for modelling.
data_m1 %<>% 
  mutate(open = (BidOpen + AskOpen)/2, close = (BidClose + AskClose)/2) %>% 
  dplyr::rename(high = BidHigh, low = AskLow) %>%  #use bid price for sell.
  dplyr::select(index, open, high, low, close)     # and ask price for buy.

Here I try to check if the filled dataset bias or not. Due to above I used open = (BidOpen + AskOpen)/2, high = BidHigh, low = AskLow and close = (BidClose + AskClose)/21. There will probably have bias.

tb3 <- data_m1 %>% mutate(
  bias.open = if_else(open>high|open<low, 1, 0), 
  bias.high = if_else(high<open|high<low|high<close, 1, 0), 
  bias.low = if_else(low>open|low>high|low>close, 1, 0), 
  bias.close = if_else(close>high|close<low, 1, 0)) %>% 
  dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)# %>% 
#  kable(caption = 'Bias Imputation') %>% 
#  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
#  scroll_box(width = '100%', height = '400px')

tb3
## # A tibble: 709,076 x 9
##    index                open  high   low close bias.open bias.high bias.low
##    <dttm>              <dbl> <dbl> <dbl> <dbl>     <dbl>     <dbl>    <dbl>
##  1 2015-01-05 00:01:00  121.  121.  121.  121.         1         1        1
##  2 2015-01-05 00:02:00  121.  121.  121.  121.         1         1        1
##  3 2015-01-05 00:04:00  121.  121.  121.  121.         1         1        0
##  4 2015-01-05 00:05:00  121.  121.  121.  121.         1         1        0
##  5 2015-01-05 00:09:00  121.  121.  121.  121.         0         0        1
##  6 2015-01-05 00:10:00  121.  121.  121.  121.         1         1        1
##  7 2015-01-05 00:11:00  121.  121.  121.  121.         1         1        1
##  8 2015-01-05 00:12:00  121.  121.  121.  121.         1         1        1
##  9 2015-01-05 00:13:00  121.  121.  121.  121.         1         1        1
## 10 2015-01-05 00:14:00  121.  121.  121.  121.         0         0        1
## # ... with 709,066 more rows, and 1 more variable: bias.close <dbl>
# -------- eval=FALSE -----------
## Below prove that the dataset has no any bias or error.
> read_rds(paste0(dtr1, '/data_m1.rds')) %>% mutate(
+     open = BidOpen, high = BidHigh, low = BidLow, close = BidClose, 
+     bias.open = if_else(open>high|open<low, 1, 0), 
+     bias.high = if_else(high<open|high<low|high<close, 1, 0), 
+     bias.low = if_else(low>open|low>high|low>close, 1, 0), 
+     bias.close = if_else(close>high|close<low, 1, 0)) %>% 
+     dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)
# A tibble: 0 x 19
# ... with 19 variables: index <dttm>, year <dbl>, week <dbl>, BidOpen <dbl>, BidHigh <dbl>, BidLow <dbl>,
#   BidClose <dbl>, AskOpen <dbl>, AskHigh <dbl>, AskLow <dbl>, AskClose <dbl>, open <dbl>, high <dbl>, low <dbl>,
#   close <dbl>, bias.open <dbl>, bias.high <dbl>, bias.low <dbl>, bias.close <dbl>

> read_rds(paste0(dtr, '/data_tm1.rds')) %>% mutate(
+     open = BidOpen, high = BidHigh, low = BidLow, close = BidClose, 
+     bias.open = if_else(open>high|open<low, 1, 0), 
+     bias.high = if_else(high<open|high<low|high<close, 1, 0), 
+     bias.low = if_else(low>open|low>high|low>close, 1, 0), 
+     bias.close = if_else(close>high|close<low, 1, 0)) %>% 
+     dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)
# A tibble: 0 x 19
# ... with 19 variables: index <dttm>, year <dbl>, week <dbl>, AskOpen <dbl>, AskHigh <dbl>, AskLow <dbl>,
#   AskClose <dbl>, BidOpen <dbl>, BidHigh <dbl>, BidLow <dbl>, BidClose <dbl>, open <dbl>, high <dbl>, low <dbl>,
#   close <dbl>, bias.open <dbl>, bias.high <dbl>, bias.low <dbl>, bias.close <dbl>

> read_rds(paste0(dtr1, '/data_m1.rds')) %>% mutate(
+     open = AskOpen, high = AskHigh, low = AskLow, close = AskClose, 
+     bias.open = if_else(open>high|open<low, 1, 0), 
+     bias.high = if_else(high<open|high<low|high<close, 1, 0), 
+     bias.low = if_else(low>open|low>high|low>close, 1, 0), 
+     bias.close = if_else(close>high|close<low, 1, 0)) %>% 
+     dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)
# A tibble: 0 x 19
# ... with 19 variables: index <dttm>, year <dbl>, week <dbl>, BidOpen <dbl>, BidHigh <dbl>, BidLow <dbl>,
#   BidClose <dbl>, AskOpen <dbl>, AskHigh <dbl>, AskLow <dbl>, AskClose <dbl>, open <dbl>, high <dbl>, low <dbl>,
#   close <dbl>, bias.open <dbl>, bias.high <dbl>, bias.low <dbl>, bias.close <dbl>

> read_rds(dtr1, paste0('/data_tm1.rds')) %>% mutate(
+     open = AskOpen, high = AskHigh, low = AskLow, close = AskClose, 
+     bias.open = if_else(open>high|open<low, 1, 0), 
+     bias.high = if_else(high<open|high<low|high<close, 1, 0), 
+     bias.low = if_else(low>open|low>high|low>close, 1, 0), 
+     bias.close = if_else(close>high|close<low, 1, 0)) %>% 
+     dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)
# A tibble: 0 x 19
# ... with 19 variables: index <dttm>, year <dbl>, week <dbl>, AskOpen <dbl>, AskHigh <dbl>, AskLow <dbl>,
#   AskClose <dbl>, BidOpen <dbl>, BidHigh <dbl>, BidLow <dbl>, BidClose <dbl>, open <dbl>, high <dbl>, low <dbl>,
#   close <dbl>, bias.open <dbl>, bias.high <dbl>, bias.low <dbl>, bias.close <dbl>

I initially try to use bid for high and ask for low in order to produce a better prediction price for buy and sell. However, I use the mean value of OHLC all prices for this paper to avoid the statistical error/bias.

Due to 1min dataset is better than (more complete) tickdata-to-1min, here I use the 1min dataset.

if(!exists('data_m1')) {
  data_m1 <- read_rds(paste0(dtr1s, '/data_m1.rds'))
}
if(names(data_m1) %>% str_detect('Bid|Ask') %>% any()) {
data_m1 %<>% 
  mutate(open = (BidOpen + AskOpen)/2, 
         high = (BidHigh + AskHigh)/2, 
         low = (BidLow + AskLow)/2, 
         close = (BidClose + AskClose)/2) %>% 
  dplyr::select(index, open, high, low, close)
}
tb4 <- data_m1 %>% mutate(
  bias.open = if_else(open>high|open<low, 1, 0), 
  bias.high = if_else(high<open|high<low|high<close, 1, 0), 
  bias.low = if_else(low>open|low>high|low>close, 1, 0), 
  bias.close = if_else(close>high|close<low, 1, 0)) %>% 
  dplyr::filter(bias.open==1|bias.high==1|bias.low==1|bias.close==1)# %>% 
#  kable(caption = 'Bias Imputation') %>% 
#  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
#  scroll_box(width = '100%', height = '400px')

tb4
## # A tibble: 709,076 x 9
##    index                open  high   low close bias.open bias.high bias.low
##    <dttm>              <dbl> <dbl> <dbl> <dbl>     <dbl>     <dbl>    <dbl>
##  1 2015-01-05 00:01:00  121.  121.  121.  121.         1         1        1
##  2 2015-01-05 00:02:00  121.  121.  121.  121.         1         1        1
##  3 2015-01-05 00:04:00  121.  121.  121.  121.         1         1        0
##  4 2015-01-05 00:05:00  121.  121.  121.  121.         1         1        0
##  5 2015-01-05 00:09:00  121.  121.  121.  121.         0         0        1
##  6 2015-01-05 00:10:00  121.  121.  121.  121.         1         1        1
##  7 2015-01-05 00:11:00  121.  121.  121.  121.         1         1        1
##  8 2015-01-05 00:12:00  121.  121.  121.  121.         1         1        1
##  9 2015-01-05 00:13:00  121.  121.  121.  121.         1         1        1
## 10 2015-01-05 00:14:00  121.  121.  121.  121.         0         0        1
## # ... with 709,066 more rows, and 1 more variable: bias.close <dbl>
//<script type="text/javascript" src="//cdn.datacamp.com/dcl-react.js.gz"></script>

Source : DataCamp Light

You are feel free to surf Online Coding Platform Example for R, Python and also Shell.

4 Modelling

4.1 Seasonal Modelling

Below articles introduce TBATS models tbats() and Dynamic harmonic regression with multiple seasonal periods auto.arima(). Here I also includes ts(), MIDAS midasr(), GARCH-MIDAS, mcsGARCH and Levy Process for this research.

Progress Function

task_progress <- function(mbase, timeID0 = NULL, scs = 60, .pattern = '^mts|^sets', .loops = TRUE) {
  ## ------------- 定时查询进度 ----------------------
  ## 每分钟自动查询与更新以上模拟预测汇价进度(储存文件量)。
  require('magrittr')
  require('tibble')
  
  if(!is.data.frame(class(mbase))) { 
    mbase %<>% data.frame
  }
  
  if (.loops == TRUE) {
    while(1) {
      cat('Current Tokyo Time :', as.character(now('Asia/Tokyo')), '\n\n')
      
      y = as_date(mbase$index) %>% 
            unique
      y <- y[weekdays(y) != 'Saturday'] #filter and omit the weekly last price which is 12:00am on saturday
        datee = y
        
        if(is.null(timeID0)) { 
            timeID0 = y[1]
        } else if (is.Date(timeID0)) { 
            timeID0 = as_date(timeID0)
        } else {
            timeID0 = as_date(mbase$index) %>% 
            unique
        }
      
        y = y[y >= timeID0]
      
      x = list.files(paste0('./data/fx/USDJPY/'), pattern = .pattern) %>% 
          str_replace_all('.rds', '') %>% 
          str_replace_all('.201', '_201') %>% 
          str_split_fixed('_', '2') %>% 
          as_tibble %>% 
          dplyr::rename('Model' = 'V1', 'Date' = 'V2') %>% 
          mutate(Model = factor(Model), Date = as_date(Date))
        
      x = join(tibble(Date = datee), x) %>% 
          as_tibble   
      x %<>% na.omit
      
      x %<>% mutate(binary = if_else(is.na(Model), 0, 1)) %>% 
          spread(Model, binary)
      
      z <- ldply(x[,-1], function(zz) {
          na.omit(zz) %>% length }) %>% 
          dplyr::rename(x = V1) %>% 
          mutate(n = length(y), progress = percent(x/n))
      
      print(z)
      
      prg = sum(z$x)/sum(z$n)
      cat('\n================', as.character(percent(prg)), '================\n\n')
      
      if (prg == 1) break #倘若进度达到100%就停止更新。
      
      Sys.sleep(scs) #以上ldply()耗时3~5秒,而休息时间60秒。
    }
  } else {
    
    cat('Current Tokyo Time :', as.character(now('Asia/Tokyo')), '\n\n')
      
    
      y = as_date(mbase$index) %>% 
            unique
      datee = y
        
      if(is.null(timeID0)) { 
          timeID0 = y[1]
      } else if (is.Date(timeID0)) { 
          timeID0 = as_date(timeID0)
      } else {
          timeID0 = as_date(mbase$index) %>% 
          unique
      }
    
      y = y[y >= timeID0]
    
      x = list.files(paste0('./data/fx/USDJPY/'), pattern = .pattern) %>% 
          str_replace_all('.rds', '') %>% 
          str_replace_all('.201', '_201') %>% 
          str_split_fixed('_', '2') %>% 
          as_tibble %>% 
          dplyr::rename('Model' = 'V1', 'Date' = 'V2') %>% 
          mutate(Model = factor(Model), Date = as_date(Date))
        
      x = join(tibble(Date = datee), x) %>% 
          as_tibble
      x %<>% na.omit
      
      x %<>% mutate(binary = if_else(is.na(Model), 0, 1)) %>% 
          spread(Model, binary)
        
      z <- ldply(x[,-1], function(zz) {
          na.omit(zz) %>% length }) %>% 
          dplyr::rename(x = V1) %>% 
          mutate(n = length(y), progress = percent(x/n))
                
    print(z)
    
    prg = sum(z$x)/sum(z$n)
    cat('\n================', as.character(percent(prg)), '================\n\n')
    }
  }

4.2 Seasonal ETS

4.2.1 ETS ts()

The forecast.ets() will automatically use the optimal ets() which is similar theory with auto.arima().

4.2.2 Weekly >> Daily

I set the length of dataset as weekly but the frequency set as 1440 minutes (per day).

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 1440) %>% 
    forecast(h = 1440) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.wk.1440.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.wk.1440.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.3 Monthly >> Daily

I set the length of dataset as monthly but the frequency set as 1440 minutes (per day). Initial forecast will be based on weekly dataset and then accumulated date-by-date until a monthly dataset.

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 1440) %>% 
    forecast(h=1440) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.mo.1440.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.mo.1440.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.4 Quarterly >> Daily

I set the length of dataset as quarterly but the frequency set as 1440 minutes (per day). Initial forecast will be based on weekly dataset and then accumulated date-by-date until a quarterly dataset.

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 1440) %>% 
    forecast(h=1440) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.qt.1440.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.qt.1440.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.5 Yearly >> Daily

I set the length of dataset as yearly but the frequency set as 1440 minutes (per day). Initial forecast will be based on weekly dataset and then accumulated date-by-date until a yearly dataset.

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% years(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 1440) %>% 
    forecast(h=1440) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.yr.1440.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.yr.1440.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.6 Weekly >> Weekly

I set the length of dataset as weekly but the frequency set as 7200 minutes (per week).

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 7200)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 7200) %>% 
    forecast(h = 7200) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 7200)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.wk.7200.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.wk.7200.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.7 Monthly >> Weekly

I set the length of dataset as monthly but the frequency set as 7200 minutes (per week).

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 7200)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 7200) %>% 
    forecast(h = 7200) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 7200)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.mo.7200.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.mo.7200.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.8 Quarterly >> Weekly

I set the length of dataset as quarterly but the frequency set as 7200 minutes (per week).

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 7200)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 7200) %>% 
    forecast(h = 7200) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 7200)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.qt.7200.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.qt.7200.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.2.9 Yearly >> Weekly

I set the length of dataset as yearly but the frequency set as 7200 minutes (per week).

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 7200)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% years(1) + seconds(59), '/', dt + seconds(59))]
  
  sets <- smp %>% 
    tk_ts(frequency = 7200) %>% 
    forecast(h = 7200) %>% 
    llply(tk_tbl)
  
  if(is.double(sets$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    sets$forecast$index <- sq
    
  } else {
    sets$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 7200)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.yr.7200.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.yr.7200.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.3 Seasonal ARIMA

4.3.1 Introduce SARIMA

If you look at the help file of auto.arima and navigate to the section “Value”, you are directed to the help file of arima function and there you find the following (under the section “Value”) regarding the arma slot: A compact form of the specification, as a vector giving the number of AR, MA, seasonal AR and seasonal MA coefficients, plus the period and the number of non-seasonal and seasonal differences. That is what the seven elements you reported correspond to. In your case, you have a non-seasonal ARIMA(1,2,0).

Source : How to read p,d and q of auto.arima()? (which is 1 among the reference link above.)

So far, we have restricted our attention to non-seasonal data and non-seasonal ARIMA models. However, ARIMA models are also capable of modelling a wide range of seasonal data. A seasonal ARIMA model is formed by including additional seasonal terms in the ARIMA models we have seen so far. It is written as follows:

ARIMA \(\underbrace{(p, d, q)}\) \(\underbrace{(P, D, Q)_{m}}\)
Non-seasonal part of the model Seasonal part of the model

where m = number of observations per year. We use uppercase notation for the seasonal parts of the model, and lowercase notation for the non-seasonal parts of the model.

The seasonal part of the model consists of terms that are similar to the non-seasonal components of the model, but involve backshifts of the seasonal period. For example, an \(ARIMA(1,1,1)(1,1,1)_{4}\) model (without a constant) is for quarterly data (m = 4), and can be written as

\[(1 - {\color{Red}\phi_{1}}B)~(1 - {\color{Red}\Phi_{1}}B^{4}) (1 - B) (1 - B^{4})y_{t} = (1 + {\color{Red}\theta_{1}}B)~ (1 + {\color{Red}\Theta_{1}}B^{4})\varepsilon_{t}\]

The additional seasonal terms are simply multiplied by the non-seasonal terms.

auto.arima(euretail, stepwise=FALSE, approximation=FALSE) is better than auto.arima(euretail).

The auto.arima() function uses nsdiffs() to determine D (the number of seasonal differences to use), and ndiffs() to determine d (the number of ordinary differences to use). The selection of the other model parameters (p, q, P and Q) are all determined by minimizing the AICc, as with non-seasonal ARIMA models.

Source : 8.9 Seasonal ARIMA models (which is 1 among the reference link above.)

Above 8.5 Non-seasonal ARIMA models reference link describe the auto.arima() and the default setting is seasonal=TRUE where it will automatically model3 .

The default arguments are designed for rapid estimation of models for many time series. If you are analysing just one time series, and can afford to take some more time, it is recommended that you set stepwise=FALSE and approximation=FALSE. Non-stepwise selection can be slow, especially for seasonal data. The stepwise algorithm outlined in Hyndman & Khandakar (2008) is used except that the default method for selecting seasonal differences is now based on an estimate of seasonal strength (Wang, Smith & Hyndman, 2006) rather than the Canova-Hansen test. There are also some other minor variations to the algorithm described in Hyndman and Khandakar (2008).

Source : help section of auto.arima().

ARIMA(2,1,1)(1,0,0)[12] is seasonal ARIMA. [12] stands for number of periods in season, i.e. months in year in this case. (1,0,0) stands for seasonal part of model. Take a look at this.

Source : extract ARIMA specificaiton (which is 1 among the reference link above.)

You can force a seasonal model by setting D=1, although auto.arima() runs for quite some time with forced seasonality. (Note that the information criteria are not comparable between the original and the differenced series.) \[ \begin{array}{l,l,l} &\text{Training} & \text{Test}\\ \mathrm{ARIMA}(2,1,1) & 5.729 & 7.657\\ \mathrm{SARIMA}(1,1,0)_{52}\text{ with drift} & 6.481 & 7.390\\ \text{3 harmonics, }\mathrm{ARIMA}(2,1,0) & 5.578 & 5.151\\ \text{4 harmonics, }\mathrm{ARIMA}(2,1,1) & 5.219 & 5.188 \end{array} \]

Source : Seasonality not taken account of in auto.arima() (which is 1 among the reference link above.)

The problem with fitting seasonal ARIMA to daily data is that the “seasonal component” may only operate on the weekends or maybe just the weekdays thus overall there is a non-significnat “seasonal component”. Now what you have to do is to augment your data set with 6 dummies representing the days of the week and perhaps monthly indicators to represent annual effects. Now consider incorporating events such as holidays and include any lead, contemoraneous or lag effect around these known variables. No there may be unusual values (pulses) or level shifts or local time trends in the data. Furthermore the day-of-the-week effects may have changed over time e.g. there was no Saturday effect for the first 20 weeks but a Saturday effect for the last 50 weeks.If you wish to post tour daily data I will give it a try and maybe other readers of the list might also contribute their analysis to help guide you through this.

Source : Auto.arima with daily data: how to capture seasonality/periodicity?

4.3.2 Modelling SARIMA

4.3.2.1 Seasonal Data

Improved auto.arima() The auto.arima() function is widely used for automatically selecting ARIMA models. It works quite well, except that selection of \(D\), the order of seasonal differencing, has always been poor. Up until now, the default has been to use the Canova-Hansen test to select \(D\). Because the CH test has a null hypothesis of deterministic seasonality based on dummy variables, the function will often select \(D=0\). So I’ve now switched to using the OCSB test for selecting \(D\) which has a null hypothesis involving a seasonal difference, so it is much more likely to choose \(D=1\) than previously. I’ve done extensive testing of the forecasts obtained under the two methods, and the OCSB test leads to better forecasts. Hence it is now the default. This means that the function may return a different ARIMA model than previously when the data are seasonal. A separate function for selecting the seasonal order has also been made visible. So you can now call nsdiffs() to find the recommended number of seasonal differences without calling auto.arima(). There is also a ndiffs() function for selecting the number of first differences. Within auto.arima(), nsdiffs() is called first to select \(D\), and then ndiffs() is applied to diff(x,D) if \(D > 0\) or to \(x\) if \(D=0\).

Double-seasonal Holt-Winters The new dshw() function implements Taylor’s (2003) double-seasonal Holt-Winters method. This allows for two levels of seasonality. For example, with hourly data, there is often a daily period of 24 and a weekly period of 168. These are modelled separately in the dshw() function.

I am planning some major new functionality to extend this to the various types of complex seasonality discussed in my recent JASA paper. Hopefully that will be ready in the next few weeks – I have a research assistant working on the new code.

Source : Major changes to the forecast package

library(forecast)
# create some artifical data
modelfitsample <- data.frame(Customer_Visit=rpois(49,3000),Weekday=rep(1:7,7),
                             Christmas=c(rep(0,40),1,rep(0,8)),Day=1:49)

# Create matrix of numeric predictors
xreg <- cbind(Weekday=model.matrix(~as.factor(modelfitsample$Weekday)), 
                  Day=modelfitsample$Day,
              Christmas=modelfitsample$Christmas)

# Remove intercept
xreg <- xreg[,-1]

# Rename columns
colnames(xreg) <- c("Mon","Tue","Wed","Thu","Fri","Sat","Day","Christmas")

# Variable to be modelled
visits <- ts(modelfitsample$Customer_Visit, frequency=7)

# Find ARIMAX model
modArima <- auto.arima(visits, xreg=xreg)

Source : How to setup xreg argument in auto.arima() in R? [closed]

library(forecast)
ts_ <- ts(PaulsData$Temperature, frequency = 1)
msts_ <- msts(ts_, c(7,30,365))
fit <- auto.arima(ts_, seasonal=F, xreg=fourier(msts_, K=c(3,5,10)))  # i,j,k

Source : Find Arima equation using auto.arima, daily long-term data (msts), 3 seasonal regressors, and calculating K in fourier

ts_ <- data_m1$close %>% 
  ts()
mts_ <- data_m1 %>% 
  msts(seasonal.periods = c(1440, 7200), start = index(.)[1])
fit1 <- auto.arima(ts_, seasonal = FALSE, xreg=fourier(mts_, K=c(3,5,10)))
fit2 <- auto.arima(ts_, seasonal = FALSE, xreg=mts_)
fit3 <- auto.arima(ts_, D = 1, xreg=mts_)

## https://stackoverflow.com/questions/12161984/how-to-elegantly-convert-datetime-from-decimal-to-d-m-y-hms
## https://stackoverflow.com/questions/17738746/r-putting-time-series-with-frequency-of-20-min-into-the-function-stl
## https://stats.stackexchange.com/questions/120806/frequency-value-for-seconds-minutes-intervals-data-in-r
## http://manishbarnwal.com/blog/2017/05/03/time_series_and_forecasting_using_R/
smp %>% 
  tk_ts(start = index(index)[1], frequency = c(1440, 7200)) %>% 
  forecast %>% 
  llply(tk_tbl)

4.3.2.2 Weekly >> Daily ts()

Here I use ts() for seasonal data modeling and set auto.arima(D = 1, seasonal = TRUE) as sarima model, sarimax models will be modeled in next paper.

I set the length of dataset as nested seasonal dataset as weekly (1 week = 5 trading days = 7200 minutes) and daily (1 trading day = 1440 minutes).

# --------- eval=FALSE ---------
# sample, not run
> suppressWarnings(Y2015W1 %>% 
                     tk_xts %>% 
                     to.daily %>% 
                     Cl %>% 
                     opt_arma(arma=TRUE))
Using column `index` for date_var.
p d q P D Q s 
0 0 0 0 0 0 1
# --------- eval=FALSE ---------
# eval(parse(text = paste0(fs, "<- read_rds('", fls[[7]], "') %>% as_tibble")))
# sample, not run

sarima <- list()
for(i in (1:length(fs))) {
    smp <- data_m1 %>% tk_xts(silent = TRUE)
    timeID <- c(index(smp), xts::last(index(smp)) + minutes(1)) %>% 
      .[. > force_tz(ymd_hms('2015-01-05 00:00:00 EET'))]
    
    if (dt %in% timeID) {
      smp <- smp[paste0(dt, '/', dt %m+% weeks(1) - seconds(59))]
      
      sarima[[i]] <- tryCatch({llply(price_type, function(y) {
        df = auto.arima(smp, parallel=FALSE, num.cores = 2)
        df = data.frame(Date = index(df$latestPrice[1]), 
                        Type = paste0(names(df$latestPrice), '.', y), 
                        df$latestPrice, df$forecastPrice, t(df$AIC))
        names(df)[4] %<>% str_replace_all('1', 'T+1')
        df
      }) %>% as_tibble %>% bind_rows}, error = function(e) NULL)
      
      if (!dir.exists(paste0('data/fx/', names(sarima[[i]])[3]))) 
        dir.create(paste0('data/fx/', names(sarima[[i]])[3]))
      
      saveRDS(sarima[[i]], paste0(
        'data/fx/', names(sarima[[i]])[3], '/sarima.', 
        unique(sarima[[i]]$Date), '.rds'))
      
      cat(paste0(
        'data/fx/', names(sarima[[i]])[3], '/sarima.', 
        unique(sarima[[i]]$Date), '.rds saved!\n'))
      }
  }
# --------- eval=FALSE ---------
# sample, not run
smp <- data_m1 %>% tk_xts(silent = TRUE)
timeID <- c(index(smp), xts::last(index(smp)) + minutes(1)) %>% 
  .[. > force_tz(ymd_hms('2015-01-05 00:00:00 EET'))]
dt <- timeID[1]
smp <- smp[paste0(dt, '/', dt %m+% weeks(1) - seconds(59))]

smp %>% tk_ts %>% forecast %>% llply(tk_tbl)

mts <- multi_seasons(smp)
aar <- multi_seasons(smp, auto_arima=TRUE)

Below Arima() and auto.arima() functions prove that auto.arima() is better model since it auto adjust the best arima(p,d,q) values.

# --------- eval=FALSE ---------
# sample, not run
> n <- 2000
> m <- 200
> y <- ts(rnorm(n) + (1:n)%%100/30, f=m)

> library(forecast)
> fit <- Arima(y, order=c(2,0,1), xreg=fourier(y, K=4))
> fit
Series: y 
Regression with ARIMA(2,0,1) errors 

Coefficients:
         ar1     ar2      ma1  intercept  S1-200  C1-200   S2-200   C2-200  S3-200   C3-200   S4-200
      0.3846  0.0649  -0.2794     1.6168  0.0354  0.0308  -1.0026  -0.0222  0.0677  -0.0163  -0.5295
s.e.  0.1588  0.0324   0.1584     0.0320  0.0453  0.0452   0.0452   0.0451  0.0450   0.0450   0.0448
      C4-200
      0.0059
s.e.  0.0447

sigma^2 estimated as 1.204:  log likelihood=-3017.65
AIC=6061.3   AICc=6061.49   BIC=6134.11

> fit2 <- auto.arima(y, seasonal=FALSE, xreg=fourier(y, K=4))
> fit2
Series: y 
Regression with ARIMA(1,0,2) errors 

Coefficients:
         ar1      ma1     ma2  intercept  S1-200  C1-200   S2-200   C2-200  S3-200   C3-200   S4-200
      0.4605  -0.3566  0.0605     1.6168  0.0354  0.0309  -1.0026  -0.0222  0.0677  -0.0164  -0.5296
s.e.  0.1319   0.1322  0.0297     0.0319  0.0451  0.0451   0.0450   0.0450  0.0449   0.0449   0.0447
      C4-200
      0.0057
s.e.  0.0447

sigma^2 estimated as 1.204:  log likelihood=-3017.44
AIC=6060.87   AICc=6061.06   BIC=6133.69

> fit$aic
[1] 6061.302
> fit2$aic
[1] 6060.873

Modeling

# --------- eval=FALSE ---------
# measure as sample take from next chunk
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]
dt <- timeID[1]

smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
dt %<>% as_date
smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]

sarimats <- smp %>% 
    tk_ts(frequency = 1440)

## 
fit_ts <- auto.arima(Op(sarimats), D = 1)#, trace = TRUE)
saveRDS(fit_ts, 'data/fx/USDJPY/sarima_ts_sample.rds')

## 
fr_ts <- forecast(fit_ts, h = 1440)
saveRDS(fr_ts, 'data/fx/USDJPY/sarima_frts_sample.rds')

## 
sq <- smp %>% 
  tail(1) %>% 
  index
if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
fr_ts.sample <- as_tibble(data.frame(index = sq, fr_ts)) %>% 
  dplyr::select(index, Point.Forecast)
dt.sample <- dplyr::filter(data_m1, index %in% fr_ts.sample$index) %>% 
  dplyr::select(index, open)
fr_ts.sample <- join(dt.sample, fr_ts.sample) %>% 
  as_tibble %>% 
  dplyr::rename(sarima_ts = Point.Forecast)

if(!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))

saveRDS(fr_ts.sample, paste0('data/fx/USDJPY/fr_ts.sample.wk.1440.', 
                         as_date(fr_ts.sample$index[1]), '.rds'))

cat(paste0(
    'data/fx/USDJPY/fr_ts.sample.wk.1440.', 
    as_date(fr_ts.sample$index[1]), '.rds saved!\n'))

Due to above model consume few hours, here I can only use a sample to compare the accuracy.

# --------- eval=FALSE ---------
#Not run
#sq <- seq(1 , length(data_m1$index), by = 1440)
#sets <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  sarimats <- smp %>% 
    tk_ts(frequency = 1440)
    #https://stackoverflow.com/a/37046276/3806250 #auto.arima(x, D = 1)
    #https://stackoverflow.com/a/37400899/3806250 #auto.arima(x, seasonal = TRUE)
  
  sarimats <- llply(., function(x) {
    auto.arima(x, D = 1) %>% #, trace = TRUE) %>% 
      forecast(h = 1440)
    }) %>% 
    llply(tk_tbl)
  
  ## ----------------------------------------
  ## Not yet test run
  sq <- smp %>% 
    tail(1) %>% 
    index
  if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
  sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
  dtf <- as_tibble(data.frame(index = sq, sarimats)) %>% 
    dplyr::select(index, Point.Forecast)
  dts <- dplyr::filter(data_m1, index %in% dtf$index) %>% 
    dplyr::select(index, open)
  dtf <- join(dt.sample, dtf) %>% 
    as_tibble
  
  if(!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))

  saveRDS(dtf, paste0('data/fx/USDJPY/sarima_ts.wk.1440.', 
                        as_date(dtf$index[1]), '.rds'))

  cat(paste0('data/fx/USDJPY/sarima_ts.wk.1440.', 
             as_date(dtf$index[1]), '.rds saved!\n'))
  ## ----------------------------------------
  }

4.3.2.3 Monthly >> Weekly >> Daily ts()

I set the length of dataset as 3 level nested seasonal dataset as monthly (), weekly (1 week = 5 trading days = 7200 minutes) and daily (1 trading day = 1440 minutes).

4.3.2.4 Yearly >> Weekly >> Daily ts()

I set the length of dataset as 3 level nested seasonal dataset as monthly (1 year = ), weekly (1 week = 5 trading days = 7200 minutes) and daily (1 trading day = 1440 minutes).

4.3.2.5 Weekly >> Daily msts()

Modeling

# --------- eval=FALSE ---------
# measure as sample take from next chunk
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]
dt <- timeID[1]

smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
dt %<>% as_date
smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]

## Dataset has 7200 observations which is 7200 mins per week
## due to not enough data to run, here I set as 60 mins and 1440 mins, therefore it can loop 5 days.
#mts <- smp %>% 
#    msts(seasonal.periods = c(1440, 7200))
sarimamsts <- smp %>% 
  msts(seasonal.periods = c(60, 1440))

##
fit_msts <- auto.arima(Op(sarimamsts), D = 1)#, trace = TRUE)
saveRDS(fit_msts, 'data/fx/USDJPY/sarima_msts_sample.rds')

##
fr_msts <- forecast(fit_msts, h = 1440)
saveRDS(fr_msts, 'data/fx/USDJPY/sarima_frmsts_sample.rds')

##

## 
sq <- smp %>% 
  tail(1) %>% 
  index
if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')

fr_msts.sample <- data.frame(index = sq, fr_msts) %>% 
  dplyr::select(index, Point.Forecast) %>% as_tibble
rownames(fr_msts.sample) <- NULL
dt.sample <- dplyr::filter(data_m1, index %in% fr_msts.sample$index) %>% 
  dplyr::select(index, open)
fr_msts.sample <- join(dt.sample, fr_msts.sample) %>% 
  as_tibble %>% 
  dplyr::rename(sarima_msts = Point.Forecast)

if(!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))

saveRDS(fr_msts.sample, paste0('data/fx/USDJPY/fr_msts.sample.wk.1440.', 
                         as_date(fr_msts.sample$index[1]), '.rds'))

cat(paste0(
    'data/fx/USDJPY/fr_msts.sample.wk.1440.', 
    as_date(fr_msts.sample$index[1]), '.rds saved!\n'))
# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  sarimamsts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200))
  
  sarimamsts <- llply(1:ncol(sarimamsts), function(i) {
    y <- sarimamsts[,i] %>% 
      auto.arima(D = 1) %>% 
      forecast(h = 1440) %>% 
      as_tibble
      #names(y)[1] <- names(smp)[i]
      #names(y)[2:ncol(y)] <- paste0(names(y)[1], '.', names(y)[2:ncol(y)])
      #names(y)[1] <- paste0(names(smp)[i], '.Point.Forecast')
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    bind_cols %>% 
    as_tibble 
  sarimamsts <- sarimamsts[c('open.Point.Forecast', 'high.Point.Forecast', 'low.Point.Forecast', 'close.Point.Forecast', 
               'open.Lo.80', 'open.Hi.80', 'open.Lo.95', 'open.Hi.95', 
               'high.Lo.80', 'high.Hi.80', 'high.Lo.95', 'high.Hi.95', 
               'low.Lo.80', 'low.Hi.80', 'low.Lo.95', 'low.Hi.95', 
               'close.Lo.80', 'close.Hi.80', 'close.Lo.95', 'close.Hi.95')]
  #sarimamsts[str_detect(names(sarimamsts), 'Model.|Period.')] <- NULL
  
  ## ----------------------------------------
  ## Not yet test run  if(is.numeric(index(sarimamsts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(sarimamsts) / length(sq)
    
    sarimamsts <- cbind(index = rep(sq, n), sarimamsts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #sarimamsts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sarimamsts, paste0('data/fx/USDJPY/sarimamsts.sample.dy.wk.', 
                       as_date(sarimamsts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sarimamsts.sample.dy.wk.', 
    as_date(sarimamsts$index[1]), '.rds saved!\n'))
  ## ----------------------------------------
  }

Due to above model consume few hours, here I can only use a sample to compare the accuracy.

4.4 TBATS forecast::tbats()

4.4.1 Modelling

4.4.2 Nested Daily-Weekly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      #names(y)[1] <- names(smp)[i]
      #names(y)[2:ncol(y)] <- paste0(names(y)[1], '.', names(y)[2:ncol(y)])
      #names(y)[1] <- paste0(names(smp)[i], '.Point.Forecast')
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    bind_cols %>% 
    as_tibble 
  mts <- mts[c('open.Point.Forecast', 'high.Point.Forecast', 'low.Point.Forecast', 'close.Point.Forecast', 
               'open.Lo.80', 'open.Hi.80', 'open.Lo.95', 'open.Hi.95', 
               'high.Lo.80', 'high.Hi.80', 'high.Lo.95', 'high.Hi.95', 
               'low.Lo.80', 'low.Hi.80', 'low.Lo.95', 'low.Hi.95', 
               'close.Lo.80', 'close.Hi.80', 'close.Lo.95', 'close.Hi.95')]
  #mts[str_detect(names(mts), 'Model.|Period.')] <- NULL
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.wk.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.wk.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

4.4.3 Nested Daily-Weekly-Monthly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(1) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200, nrow(smp)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk.mo'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    join_all %>% 
    as_tibble
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.wk.mo.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.wk.mo.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

4.4.4 Nested Daily-Weekly-Quarterly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200, nrow(smp)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk.qt'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    join_all %>% 
    as_tibble
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.wk.qt.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.wk.qt.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

Due to heavily calculation and based on the comparison section proved that 2 levels (or layers) nested model more effective than 3 levels (or layers) models, here I skip above model.

4.4.5 Nested Daily-Weekly-Yearly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% years(1) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200, nrow(smp)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk.yr'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    join_all %>% 
    as_tibble
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.wk.yr.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.wk.yr.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

Due to heavily calculation and based on the comparison section proved that 2 levels (or layers) nested model more effective than 3 levels (or layers) models, here I skip above model.

4.4.6 Nested Daily-Weekly-Monthly-Quarterly-Yearly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  
  ##https://robjhyndman.com/hyndsight/seasonal-periods/
  yr1 <- smp[paste0(dt %m-% years(1) + seconds(59), '/', dt + seconds(59))]
  qt1 <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200, nrow(qt1), nrow(yr1)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.wk.qt.yr'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    join_all %>% 
    as_tibble
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.wk.qt.yr.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.wk.qt.yr.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

Due to heavily calculation and based on the comparison section proved that 2 levels (or layers) nested model more effective than 3 levels (or layers) models, here I skip above model.

4.4.7 Nested Daily-Quarterly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, nrow(smp)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.qt'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      
      }) %>% 
    bind_cols %>% 
    as_tibble 
  mts <- mts[c('open.Point.Forecast', 'high.Point.Forecast', 'low.Point.Forecast', 'close.Point.Forecast', 
               'open.Lo.80', 'open.Hi.80', 'open.Lo.95', 'open.Hi.95', 
               'high.Lo.80', 'high.Hi.80', 'high.Lo.95', 'high.Hi.95', 
               'low.Lo.80', 'low.Hi.80', 'low.Lo.95', 'low.Hi.95', 
               'close.Lo.80', 'close.Hi.80', 'close.Lo.95', 'close.Hi.95')]
  #mts[str_detect(names(mts), 'Model.|Period.')] <- NULL
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.qt.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.qt.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }

4.4.8 Nested Daily-Yearly Model

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% years(1) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, nrow(smp)))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% 
    bind_rows %>% 
    mutate(Model = factor('tbats'), Period = factor('dy.yr'), type = case_when(
      !is.na(open) ~ 'open', 
      !is.na(high) ~ 'high', 
      !is.na(low) ~ 'low', 
      !is.na(close) ~ 'close')) %>% 
    dlply(.(type, Period), function(x) {
      x %<>% dplyr::rename(open.Point.Forecast = open, 
                           high.Point.Forecast = high, 
                           low.Point.Forecast = low, 
                           close.Point.Forecast = close)
      names(x)[str_detect(names(x), '80|95')] <- paste0(x$type[1], '.', names(x)[str_detect(names(x), '80|95')])
      x[colSums(!is.na(x)) > 0] %<>% 
        data.frame %>% 
        as_tibble %>% 
        dplyr::select(-type)
      #x[c(ncol(x), ncol(x)-1, x[1:(ncol(x)-2)])] #Due to xts format attr, there will be not in order.
      
      }) %>% 
    bind_cols %>% 
    as_tibble 
  mts <- mts[c('open.Point.Forecast', 'high.Point.Forecast', 'low.Point.Forecast', 'close.Point.Forecast', 
               'open.Lo.80', 'open.Hi.80', 'open.Lo.95', 'open.Hi.95', 
               'high.Lo.80', 'high.Hi.80', 'high.Lo.95', 'high.Hi.95', 
               'low.Lo.80', 'low.Hi.80', 'low.Lo.95', 'low.Hi.95', 
               'close.Lo.80', 'close.Hi.80', 'close.Lo.95', 'close.Hi.95')]
  #mts[str_detect(names(mts), 'Model.|Period.')] <- NULL
  
  if(is.numeric(index(mts)[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    n <- nrow(mts) / length(sq)
    
    mts <- cbind(index = rep(sq, n), mts) %>% 
      as_tibble
    
  } else {
    stop('index of dataset does not assign.')
    #mts$forecast$index <- data_m1$index[
    #(which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1):(
    # which(data_m1$index == smp %>% 
    #         index %>% 
    #         xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(mts, paste0('data/fx/USDJPY/mts.dy.yr.', 
                       as_date(mts$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/mts.dy.yr.', 
    as_date(mts$index[1]), '.rds saved!\n'))
  }
seasonal_m1 <- read_rds('data/fx/USDJPY/seasonal_m1.rds')
yr_2018 <- data.table(seasonal_m1)[as_date(index) > as_date('2017-12-31')]

dy.qt_dy.yr_2018 <- yr_2018[Model == 'tbats' & Period %in% c('dy.qt', 'dy.yr')]

4.4.9 Nested Weekly-Weekly Model

Based on the comparison section proved that daily (1440 mins) nested model more effective than weekly (7200 mins) nested models, here I skip above model.

4.4.10 Nested Weekly-Monthly Model

Based on the comparison section proved that daily (1440 mins) nested model more effective than weekly (7200 mins) nested models, here I skip above model.

4.4.11 Nested Weekly-Quarterly Model

Based on the comparison section proved that daily (1440 mins) nested model more effective than weekly (7200 mins) nested models, here I skip above model.

4.4.12 Nested Weekly-Yearly Model

Based on the comparison section proved that daily (1440 mins) nested model more effective than weekly (7200 mins) nested models, here I skip above model.

## Due to notice there have bias on `qt` and `yr` models after 2 years 2020 from 2018... might probably due to different reasons.

## mts.dy.wk.
ffl <- list.files('data/fx/USDJPY', pattern = 'mts.dy.wk.[0-9]{4}')
smp <- llply(ffl, function(x) {
    read_rds(paste0('data/fx/USDJPY/', x))
  })

smp_wk <- smp %>% 
  bind_rows()
smp_wk %<>% 
  .[c('index', 'open.Point.Forecast', 'high.Point.Forecast',
  'low.Point.Forecast', 'close.Point.Forecast')]
smp_wk <- join(data_m1, smp_wk)
smp_wk %<>% 
  tibble %>% 
  na.omit

## mts.dy.wk.mo
ffl <- list.files('data/fx/USDJPY', pattern = 'mts.dy.wk.mo.[0-9]{4}')
smp <- llply(ffl, function(x) {
    read_rds(paste0('data/fx/USDJPY/', x))
  })

smp_wk.mo <- smp %>% 
  bind_rows()
smp_wk.mo %<>% 
  .[c('index', 'open.Point.Forecast', 'high.Point.Forecast',
  'low.Point.Forecast', 'close.Point.Forecast')]
smp_wk.mo <- join(data_m1, smp_wk.mo)
smp_wk.mo %<>% 
  tibble %>% 
  na.omit

## mts.dy.qt.
ffl <- list.files('data/fx/USDJPY', pattern = 'mts.dy.qt.[0-9]{4}')
smp <- llply(ffl, function(x) {
    read_rds(paste0('data/fx/USDJPY/', x))
  })

smp_qt <- smp %>% 
  bind_rows()
smp_qt %<>% 
  .[c('index', 'open.Point.Forecast', 'high.Point.Forecast',
  'low.Point.Forecast', 'close.Point.Forecast')]
smp_qt <- join(data_m1, smp_qt)
smp_qt %<>% 
  tibble %>% 
  na.omit

## mts.dy.yr.
ffl <- list.files('data/fx/USDJPY', pattern = 'mts.dy.yr.[0-9]{4}')
smp <- llply(ffl, function(x) {
    read_rds(paste0('data/fx/USDJPY/', x))
  })

smp_yr <- smp %>% 
  bind_rows()
smp_yr %<>% 
  .[c('index', 'open.Point.Forecast', 'high.Point.Forecast', 
      'low.Point.Forecast', 'close.Point.Forecast')]
smp_yr <- join(data_m1, smp_yr)
smp_yr %<>% 
  tibble %>% 
  na.omit

rm(ffl, smp)

## trace and check the bias
smp_wkc <- smp_wk %>% 
    ddply(.(date = as_date(index)), summarise, 
          MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
          MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
          MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
          MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
          MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
          MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
          n = length(index)) %>% 
    as_tibble
smp_wkc <- data.frame(model = factor('mts.dy.wk'), smp_wkc) %>% 
  tibble

smp_wk.moc <- smp_wk.mo %>% 
    ddply(.(date = as_date(index)), summarise, 
          MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
          MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
          MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
          MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
          MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
          MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
          n = length(index)) %>% 
    as_tibble
smp_wk.moc <- data.frame(model = factor('mts.dy.wk.mo'), smp_wk.moc) %>% 
  tibble

smp_qtc <- smp_qt %>% 
    ddply(.(date = as_date(index)), summarise, 
          MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
          MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
          MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
          MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
          MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
          MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
          n = length(index)) %>% 
    as_tibble
smp_qtc <- data.frame(model = factor('mts.dy.qt'), smp_qtc) %>% 
  tibble

smp_yrc <- smp_yr %>% 
    ddply(.(date = as_date(index)), summarise, 
          MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
          MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
          MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
          MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
          MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
          MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
          n = length(index)) %>% 
    as_tibble
smp_yrc <- data.frame(model = factor('mts.dy.yr'), smp_yrc) %>% 
  tibble

smpp <- list(smp_wkc, smp_wk.moc, smp_qtc, smp_yrc) %>% 
  bind_rows

MSE.open <- smpp %>% 
    dplyr::select(date, model, MSE.open, n) %>% 
    spread(model, MSE.open) %>% 
  na.omit %>% 
    mutate(mean = rowMeans(
      select(., mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr)))

MSE.high <- smpp %>% 
    dplyr::select(date, model, MSE.high, n) %>% 
    spread(model, MSE.high) %>% 
  na.omit %>% 
    mutate(mean = rowMeans(
      select(., mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr)))

MSE.low <- smpp %>% 
    dplyr::select(date, model, MSE.low, n) %>% 
    spread(model, MSE.low) %>% 
  na.omit %>% 
    mutate(mean = rowMeans(
      select(., mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr)))

MSE.close <- smpp %>% 
    dplyr::select(date, model, MSE.close, n) %>% 
    spread(model, MSE.close) %>% 
  na.omit %>% 
    mutate(mean = rowMeans(
      select(., mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr)))

select(MSE.open, c(mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr, mean)) %>% colMeans
#   mts.dy.wk mts.dy.wk.mo    mts.dy.qt    mts.dy.yr         mean 
#   0.2931847    0.3066926    0.6637179    3.0892483    1.0882109 
select(MSE.high, c(mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr, mean)) %>% colMeans
#   mts.dy.wk mts.dy.wk.mo    mts.dy.qt    mts.dy.yr         mean 
#   0.2824914    0.3044910    0.6679225    3.1030069    1.0894780 
select(MSE.low, c(mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr, mean)) %>% colMeans
#   mts.dy.wk mts.dy.wk.mo    mts.dy.qt    mts.dy.yr         mean 
#   0.2798276    0.3028962    0.6615109    3.0781766    1.0806028 
select(MSE.close, c(mts.dy.wk, mts.dy.wk.mo, mts.dy.qt, mts.dy.yr, mean)) %>% colMeans
#   mts.dy.wk mts.dy.wk.mo    mts.dy.qt    mts.dy.yr         mean 
#   0.2997343    0.2947651    0.6627861    3.0969951    1.0885702
> list(smp_wkc, smp_wk.moc, smp_qtc, smp_yrc) %>% 
  l_ply(function(x) length(x$n), .print = TRUE)
[1] 1084
[1] 1076
[1] 1084
[1] 1084

chk1 <- MSE.open %>% 
    mutate(
        diff1 = abs(mts.dy.wk - mean), 
        diff2 = abs(mts.dy.wk.mo - mean),
        diff3 = abs(mts.dy.qt - mean),
        diff4 = abs(mts.dy.yr - mean)) %>% 
    mutate_if(is.numeric, round, 4) %>% 
    data.frame

chk1a <- chk1 %>% 
  dplyr::filter(diff1 >= 0.05 | diff2 >= 0.05 | diff3 >= 0.05 | diff4 >= 0.05)
chk1a[1:100,]

4.5 Seasonal Models seasonal::seas()

# --------- eval=FALSE ---------
#sq <- seq(1 , length(data_m1$index), by = 1440)
#mts <- list()
timeID <- data_m1$index %>% 
  as_date %>% 
  unique %>% 
  sort
timeID %<>% .[. > as_date('2015-01-11')]

for (dt in timeID) {
  smp <- data_m1 %>% 
    tk_xts(silent = TRUE)
  dt %<>% as_date
  smp <- smp[paste0(dt %m-% weeks(1) + seconds(59), '/', dt + seconds(59))]
  
  mts <- smp %>% 
    msts(seasonal.periods = c(1440, 7200))
  
  mts <- llply(1:ncol(mts), function(i) {
    y <- mts[,i] %>% 
      tbats %>% 
      forecast(h = 1440) %>% 
      as_tibble
      names(y)[1] <- names(smp)[i]
      y
    }) %>% bind_rows
  
  if(is.double(mts$forecast$index[1])){
    sq <- smp %>% 
      tail(1) %>% 
      index
    if(weekdays(sq) == '土曜日'|weekdays(sq) == 'Saturday') sq <- sq + days(2)
    sq <- seq(from = sq + minutes(1), sq + days(1), by = 'min')
    mts$forecast$index <- sq
    
  } else {
    mts$forecast$index <- data_m1$index[
    (which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1):(
     which(data_m1$index == smp %>% 
             index %>% 
             xts::last()) + 1440)]
  }
  
  if (!dir.exists(paste0('data/fx/USDJPY'))) 
    dir.create(paste0('data/fx/USDJPY'))
  
  saveRDS(sets, paste0('data/fx/USDJPY/sets.wk.1440.', 
                       as_date(sets$forecast$index[1]), '.rds'))
  
  cat(paste0(
    'data/fx/USDJPY/sets.wk.1440.', 
    as_date(sets$forecast$index[1]), '.rds saved!\n'))
  }

4.6 MIDAS

Mixed Frequency Data Sampling Regression Models - The R Package midasr introduce a midas model.

4.7 GARCH-MIDAS

4.8 mcsGARCH

I have just noticed there has another GARCH model in rugarch package and then I roughly read through below articles. This multiplicative component GARCH model is different with normal GARCH model due to it includes the effects of volatility within a day. It is designate for intraday dataset.

## ------------- Simulate uv_fx() ----------------------
## uv_fx just made the model and some argument flexible.
mcsGARCH <- list()

for (dt in timeID) {
  
  for (i in seq(cr_code)) {
    
    smp <- mbase[[names(cr_code)[i]]]
    timeID2 <- c(index(smp), xts::last(index(smp)) + days(1))
    
    if (dt %in% timeID2) {
      dtr <- xts::last(index(smp[index(smp) < dt]), 1) #tail(..., 1)
      smp <- smp[paste0(dtr %m-% years(1), '/', dtr)]
      
      mcsGARCH[[i]] <- tryCatch({llply(price_type, function(y) {
        df = uv_fx(smp, .model = 'mcsGARCH', currency = cr_code[i], 
                   price = y, .cluster = .cl)
        df = data.frame(Date = index(df$latestPrice[1]), 
                        Type = paste0(names(df$latestPrice), '.', y), 
                        df$latestPrice, df$forecastPrice, t(df$AIC))
        names(df)[4] %<>% str_replace_all('1', 'T+1')
        df
      }) %>% as_tibble %>% bind_rows}, error = function(e) NULL)
      
      if (!dir.exists(paste0('data/fx/', names(mcsGARCH[[i]])[3]))) 
        dir.create(paste0('data/fx/', names(mcsGARCH[[i]])[3]))
      
      saveRDS(mcsGARCH[[i]], paste0(
        'data/fx/', names(mcsGARCH[[i]])[3], '/mcsGARCH.', 
        unique(mcsGARCH[[i]]$Date), '.rds'))
    
      cat(paste0(
        'data/fx/', names(mcsGARCH[[i]])[3], '/mcsGARCH.', 
        unique(mcsGARCH[[i]]$Date), '.rds saved!\n'))
    }
    }; rm(i)
  }

4.9 Levy Process

5 Comparison

5.1 1 min per unit

5.1.1 Seasonal ts and msts

Here I read the saved models.

## Get all files.
fls <- paste0('data/fx/USDJPY/', list.files(
  'data/fx/USDJPY/', pattern = '^sets|^mts'))

## Shows example.
# read_rds(grep('sets', fls, value = TRUE)[1])
# read_rds(grep('mts', fls, value = TRUE)[1]) %>% as_tibble

seasonal_m <- llply(fls, function(x) {
  
  if(str_detect(x, 'sets.wk.1440.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('wk.1440'))
    
  } else if(str_detect(x, 'sets.mo.1440.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('mo.1440'))
    
  } else if(str_detect(x, 'sets.qt.1440.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('qt.1440'))
    
  } else if(str_detect(x, 'sets.yr.1440.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('yr.1440'))
    
  } else if(str_detect(x, 'sets.wk.7200.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('wk.7200'))
    
  } else if(str_detect(x, 'sets.mo.7200.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('mo.7200'))
    
  } else if(str_detect(x, 'sets.qt.7200.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('qt.7200'))
    
  } else if(str_detect(x, 'sets.yr.7200.')) {
    read_rds(x)$forecast %>% 
      mutate(Model = factor('ts'), Period = factor('yr.7200'))
    
  } else if(str_detect(x, 'mts.dy.wk.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.wk'))
    
  } else if(str_detect(x, 'mts.dy.qt.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.qt'))
    
  } else if(str_detect(x, 'mts.dy.yr.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.yr'))
    
  } else if(str_detect(x, 'mts.wk.qt.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('wk.qt'))
    
  } else if(str_detect(x, 'mts.wk.qt.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('wk.yr'))
    
  } else if(str_detect(x, 'mts.qt.yr.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('qt.yr'))
    
  }  else if(str_detect(x, 'mts.dy.wk.mo.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.wk.mo'))
    
  } else if(str_detect(x, 'mts.dy.wk.mo.qt.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.wk.mo.qt'))
    
  } else if(str_detect(x, 'mts.dy.wk.mo.yr.[0-9]{4}')) {
    read_rds(x) %>% 
      mutate(Model = factor('tbats'), Period = factor('dy.wk.mo.yr'))
    
  } else {
    cat('No such files.\n')
  }
  }) %>% 
  bind_rows %>% 
  as_tibble

# seasonal_m[c('Lo.80', 
#              'close.Lo.80', 'close.Hi.80', 'close.Lo.95', 'close.Hi.95', 
#              'high.Hi.80', 'high.Lo.95', 'high.Hi.95', 
#              'high.high.Point.Forecast', 'low.Hi.80', 'low.Lo.95', 
#              'low.Hi.95', 'open.Hi.80', 'open.Lo.95', 'open.Hi.95', 
#              'open.Lo.80', 'high.Lo.80', 'low.Lo.80', 'close.Lo.80')] <- NULL

## don't use complete.cases() since there has some NA elements in ts models.
#seasonal_m <- seasonal_m[complete.cases(seasonal_m),]
#dataset with 23
write_rds(seasonal_m, 'data/fx/USDJPY/seasonal_m.rds')
seasonal_m1 <- seasonal_m
rm(seasonal_m, data_m1)

seasonal_m1 %<>% 
  .[c('index','Model','Period',
  'open.Point.Forecast','high.Point.Forecast',
  'low.Point.Forecast','close.Point.Forecast')]#,
#  'open.Point.Forecast.Hi 80','open.Point.Forecast.Lo 80',
#  'open.Point.Forecast.Lo 95','open.Point.Forecast.Hi 95',
#  'high.Point.Forecast.Lo 80','high.Point.Forecast.Hi 80',
#  'high.Point.Forecast.Lo 95','high.Point.Forecast.Hi 95',
#  'low.Point.Forecast.Lo 80','low.Point.Forecast.Hi 80',
#  'low.Point.Forecast.Lo 95','low.Point.Forecast.Hi 95',
#  'close.Point.Forecast.Lo 80','close.Point.Forecast.Hi 80',
#  'close.Point.Forecast.Lo 95','close.Point.Forecast.Hi 95')]

##
#seasonal_m <- llply(fls, function(x) {
#  read_rds(x)$forecast %>% 
#    mutate(
#      Model = case_when(
#        grepl('sets.wk.1440.', x) ~ factor('ts'), 
#        grepl('sets.mo.1440.', x) ~ factor('ts'), 
#        grepl('sets.qt.1440.', x) ~ factor('ts'), 
#        grepl('sets.yr.1440.', x) ~ factor('ts'), 
#        grepl('sets.wk.7200.', x) ~ factor('ts'), 
#        grepl('sets.mo.7200.', x) ~ factor('ts'), 
#        grepl('sets.qt.7200.', x) ~ factor('ts'), 
#        grepl('sets.yr.7200.', x) ~ factor('ts'), 
#        grepl('mts.dy.wk.[0-9]{4}', x) ~ factor('tbats'), 
#        grepl('mts.dy.wk.mo.[0-9]{4}', x) ~ factor('tbats'), 
#        grepl('mts.dy.wk.mo.qt.[0-9]{4}', x) ~ factor('tbats'), 
#        grepl('mts.dy.wk.mo.yr.[0-9]{4}', x) ~ factor('tbats'), 
#        FALSE~ stop('No such files.')), 
#      Period = factor('wk.1440'), 
#      Period = factor('mo.1440'), 
#      Period = factor('qt.1440'), 
#      Period = factor('yr.1440'), 
#      Period = factor('wk.7200'), 
#      Period = factor('mo.7200'), 
#      Period = factor('qt.7200'), 
#      Period = factor('yr.7200'), 
#      Period = factor('dy.wk'), 
#      Period = factor('dy.wk.mo'), 
#      Period = factor('dy.wk.mo.qt'), 
#      Period = factor('dy.wk.mo.yr'))
#
  #} else {
  #  stop('No such files.')
  #}
#  }) %>% 
#  bind_rows %>% 
#  as_tibble

##The last observation of Friday is Saturday 00:00:00 but not next Monday 00:00:00. Therefore the Saturday forecasted price will not be merge with Next Monday market price.
#comp %<>% .[colSums(!is.na(.)) > 0]
seasonal_m1 <- join(data_m1, seasonal_m1) %>% 
  bind_rows %>% 
  as_tibble

seasonal_m1 %<>% 
  .[c('index','Model','Period','open','high','low','close',
  'open.Point.Forecast','high.Point.Forecast',
  'low.Point.Forecast','close.Point.Forecast')]#,
#  'open.Point.Forecast.Hi 80','open.Point.Forecast.Lo 80',
#  'open.Point.Forecast.Lo 95','open.Point.Forecast.Hi 95',
#  'high.Point.Forecast.Lo 80','high.Point.Forecast.Hi 80',
#  'high.Point.Forecast.Lo 95','high.Point.Forecast.Hi 95',
#  'low.Point.Forecast.Lo 80','low.Point.Forecast.Hi 80',
#  'low.Point.Forecast.Lo 95','low.Point.Forecast.Hi 95',
#  'close.Point.Forecast.Lo 80','close.Point.Forecast.Hi 80',
#  'close.Point.Forecast.Lo 95','close.Point.Forecast.Hi 95')]

seasonal_m1 %<>% na.omit

## don't use complete.cases() since there has some NA elements in ts models.
#seasonal_m <- seasonal_m[complete.cases(seasonal_m),]
write_rds(seasonal_m1, 'data/fx/USDJPY/seasonal_m1.rds')
#zip it to be splited 99MB for each file.

## ------------------------------------------
## zip above files to be splitted small files since file sizes restriction on GitHub.
## ------------------------------------------
#dir('data/fx/USDJPY', pattern = '*.z') %>% 
#  llply(., function(x) {
#    suppressAll(unzip(paste0('data/fx/USDJPY/', x)))
#  })
seasonal_m1 <- read_rds('data/fx/USDJPY/seasonal_m1.rds')

## https://stackoverflow.com/a/52490634/3806250
#seasonal_m1[is.nan(seasonal_m1)] <- NA

5.1.1.1 Line Graph & Trend

Below graph shows the forecast price and actual price.

5.1.1.1.1 Overview
grph <- seasonal_m1 %>% 
  tidyr::unite(Model, Model:Period) %>% 
  data.table
prc <- unique(grph[, .(index, open, high, low, close)])
prc <- prc[, Model := 'Market.Price'][]
grph <- grph[, (c('open', 'high', 'low', 'close')) := NULL]
names(grph) <- c('index', 'Model', 'open', 'high', 'low', 'close')
grph <- rbind(grph, prc)
grph <- data.table(grph)[order(index)]
rm(prc)

## save dataset in data.table format
saveRDS(grph, 'data/fx/USDJPY/grph.rds')
# fwrite(data.table(grph), 'data/fx/USDJPY/grph.csv')
# write.table(data.table(grph), 'data/fx/USDJPY/grph.txt')

## https://rstudio-pubs-static.s3.amazonaws.com/31702_9c22e3d1a0c44968a4a1f9656f1800ab.html
grph_json <- rjson::toJSON(grph)
write(grph_json, 'data/fx/USDJPY/grph_json.json')

#grph_json <- fromJSON('data/fx/USDJPY/grph_json.json')
grph <- readRDS('data/fx/USDJPY/grph.rds')
data.frame(grph)[c(1:5, (nrow(grph)-5):nrow(grph)),] %>% 
  kbl('html', caption = 'Data Sample', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '100%')
Data Sample
index Model open high low close
1 2015-01-12 00:01:00 tbats_dy.qt 118.5390 118.5614 118.5230 118.5480
2 2015-01-12 00:01:00 tbats_dy.wk 118.5390 118.5614 118.5230 118.5480
3 2015-01-12 00:01:00 tbats_dy.yr 118.5390 118.5614 118.5230 118.5480
4 2015-01-12 00:01:00 ts_mo.1440 118.5907 118.6257 118.5749 118.6095
5 2015-01-12 00:01:00 ts_mo.7200 118.5390 118.5626 118.5260 118.5480
18849595 2018-07-07 00:00:00 ts_wk.7200 110.6450 110.6435 110.5675 110.5737
18849596 2018-07-07 00:00:00 ts_wk.7200 110.6450 110.6435 110.5675 110.5737
18849597 2018-07-07 00:00:00 ts_wk.7200 110.6450 110.6435 110.5675 110.5737
18849598 2018-07-07 00:00:00 ts_wk.7200 110.6450 110.6435 110.5675 110.5737
18849599 2018-07-07 00:00:00 ts_yr.1440 110.6449 110.6492 110.5636 110.5707
18849600 2018-07-07 00:00:00 Market.Price 110.4635 110.4540 110.4770 110.4740

the dataset above has 18849600 x, 6 x dimensions.

## https://plotly.com/r/embedding-graphs-in-rmarkdown
## https://stackoverflow.com/questions/25186022/embedding-plotly-output-in-r-markdown/25192691
## 
fig <- plot_ly(grph, x = ~index, y = ~open, color = ~Model) 
fig <- fig %>% add_lines()
fig
5.1.1.1.2 Open Price
## ------------ eval = FALSE -------------------
## Due to high volume dataset and heavily ploting, here I ommit it.
grph %>% 
    group_by(Model) %>% 
    e_charts(x = index) %>% 
    e_line(open.Point.Forecast, smooth = TRUE) %>% 
  e_datazoom(
    type = 'slider', 
    toolbox = FALSE,
    bottom = -5) %>% 
  e_tooltip() %>% 
  e_title(text = 'Model', subtext = 'open.Point.Forecast', left = 'center') %>% 
  e_axis_labels(x = 'index', y = 'open.Point.Forecast') %>%
  e_x_axis(index, axisPointer = list(show = TRUE)) %>% 
  e_legend(
    orient = 'vertical', 
    type = c('scroll'), 
    #selectedMode = 'multiple', #https://echarts.apache.org/en/option.html#legend
    #selected = list('Model'), 
    left = 0, top = 80) %>% 
  e_grid(left = 150, top = 90) %>% 
  #e_theme('shine') %>% 
  e_toolbox_feature('saveAsImage', title = 'Screenshot')
## ggthemes
palettes1 <- ggthemes_data[['tableau']][['color-palettes']][['ordered-sequential']]
## https://github.com/BTJ01/ggthemes/blob/master/inst/examples/ex-scale_color_tableau.R
palettes2 <- ggthemes_data[["tableau"]][["color-palettes"]][["regular"]]

## -------------------------------
## ggthemr
## https://www.shanelynn.ie/themes-and-colours-for-r-ggplots-with-ggthemr/

#tableau_colours <- c('#1F77B4', '#FF7F0E', '#2CA02C', '#D62728', '#9467BD', '#8C564B', '#CFECF9', '#7F7F7F', '#BCBD22', '#17BECF')
tableau_colours <- palettes2$`Tableau 20`$value
names(tableau_colours) <- palettes2$`Tableau 20`$name

#names(tableau_colours) <- unique(grph$Model)

## https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12
#tableau_colours <- c('#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928')

# you have to add a colour at the start of your palette for outlining boxes, we'll use a grey:
#tableau_colours <- c("#555555", tableau_colours)
# remove previous effects:
ggthemr_reset()

# Define colours for your figures with define_palette
tableau <- define_palette(
    swatch = tableau_colours, # colours for plotting points and bars
    ## https://stackoverflow.com/questions/7014387/whats-the-difference-between-1l-and-1
    gradient = c(lower = tableau_colours[1L], upper = tableau_colours[length(tableau_colours)]), #upper and lower colours for continuous colours
    #background = "#EEEEEE" #defining a grey-ish background 
)
# set the theme for your figures:
ggthemr(tableau)

## ------------------------
## https://stackoverflow.com/questions/34601194/change-colours-to-defined-palette-for-ggplot-objects
change_colours <- function(p, palette) {
  n <- nlevels(p$data[[deparse(p$mapping$group)]])
  tryCatch(as.character(palette), 
           error=function(e) stop('palette should be a vector of colours', call.=FALSE))
  if(n > length(palette)) stop('Not enough colours in palette.')
  pal <- function(n) palette[seq_len(n)]
  p + theme_light() + discrete_scale('colour', 'foo', pal)
}
## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p1 <- grph %>% 
  ggplot(aes(x = index, y = open, group = Model, color = Model)) + 
  geom_line() + 
  #scale_colour_gradient2_tableau(palette = names(palettes)[1]) + #first palettes list in name
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Open Price Forecasting', 
       subtitle = paste('From', range(unique(grph$index))[1L], 'to', range(unique(grph$index))[2L]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  ##scale_fill_manual(values = tableau_colours) + 
  #scale_color_brewer(tableau_colours) + 
  #scale_color_jcolors(palette = palettes2$`Tableau 20`$value) + #choose color set among palettes
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

#ggplotly(p1)
p1

5.1.1.1.3 High Price
rm(p1)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p2 <- grph %>% 
  ggplot(aes(x = index, y = high, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min High Price Forecasting', 
       subtitle = paste('From', range(unique(grph$index))[1L], 'to', range(unique(grph$index))[2L]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

#ggplotly(p2)
p2

5.1.1.1.4 Low Price
rm(p2)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p3 <- grph %>% 
  ggplot(aes(x = index, y = low, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Low Price Forecasting', 
       subtitle = paste('From', range(unique(grph$index))[1], 'to', range(unique(grph$index))[2]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

#ggplotly(p3)
p3

5.1.1.1.5 Close Price
rm(p3)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p4 <- grph %>% 
  ggplot(aes(x = index, y = close, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Close Price Forecasting', 
       subtitle = paste('From', range(unique(grph$index))[1], 'to', range(unique(grph$index))[2]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

#ggplotly(p4)
p4

5.1.1.2 MSE Table

Below table compares the models.

rm(p4)

mse1 <- seasonal_m1 %>% 
  ddply(.(Model, Period), summarise, 
        MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
        MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
        MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
        MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
        MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
        MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
        n = length(index)) %>% 
  as_tibble
tb6 <- mse1 %>% 
  mutate(
    MSE.open = ifelse(
      rank(MSE.open) <= 3, 
      cell_spec(
        paste0(round(MSE.open, 7), ' (rank: ', sprintf('%1.f', rank(MSE.open)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.open, 7), ' (rank: ', sprintf('%1.f', rank(MSE.open)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.high = ifelse(
      rank(MSE.high) <= 3, 
      cell_spec(
        paste0(round(MSE.high, 7), ' (rank: ', sprintf('%1.f', rank(MSE.high)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.high, 7), ' (rank: ', sprintf('%1.f', rank(MSE.high)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.low = ifelse(
      rank(MSE.low) <= 3, 
      cell_spec(
        paste0(round(MSE.low, 7), ' (rank: ', sprintf('%1.f', rank(MSE.low)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.low, 7), ' (rank: ', sprintf('%1.f', rank(MSE.low)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.close = ifelse(
      rank(MSE.close) <= 3, 
      cell_spec(
        paste0(round(MSE.close, 7), ' (rank: ', sprintf('%1.f', rank(MSE.close)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.close, 7), ' (rank: ', sprintf('%1.f', rank(MSE.close)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.HLC = ifelse(
      rank(MSE.HLC) <= 3, 
      cell_spec(
        paste0(round(MSE.HLC, 7), ' (rank: ', sprintf('%1.f', rank(MSE.HLC)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.HLC, 7), ' (rank: ', sprintf('%1.f', rank(MSE.HLC)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.OHLC = ifelse(
      rank(MSE.OHLC) <= 3, 
      cell_spec(
        paste0(round(MSE.OHLC, 7), ' (rank: ', sprintf('%1.f', rank(MSE.OHLC)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.OHLC, 7), ' (rank: ', sprintf('%1.f', rank(MSE.OHLC)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'MSE of Seasonal Daily 1440 minutes ETS Model (Accumulated Period from Weekly)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>% 
  column_spec(7, background = 'Gainsboro') %>%  
  column_spec(8, background = 'LightGray') %>% 
  column_spec(9, background = 'LightSlateGrey') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

rm(mse1)
tb6
MSE of Seasonal Daily 1440 minutes ETS Model (Accumulated Period from Weekly)
Model Period MSE.open MSE.high MSE.low MSE.close MSE.HLC MSE.OHLC n
tbats dy.qt 0.5935084 (rank: 11) 0.5946396 (rank: 11) 0.593577 (rank: 11) 0.59344 (rank: 11) 0.5938855 (rank: 11) 0.5937912 (rank: 11) 1298880
tbats dy.wk 0.2331241 (rank: 1) 0.2305384 (rank: 1) 0.2331357 (rank: 1) 0.2415673 (rank: 4) 0.2350805 (rank: 2) 0.2345914 (rank: 1) 1298880
tbats dy.wk.mo 0.2585134 (rank: 6) 0.2531527 (rank: 7) 0.2511519 (rank: 6) 0.2468493 (rank: 5) 0.2503846 (rank: 6) 0.2524168 (rank: 6) 1287360
tbats dy.yr 2.992332 (rank: 12) 3.0002451 (rank: 12) 2.989127 (rank: 12) 3.0017416 (rank: 12) 2.9970379 (rank: 12) 2.9958614 (rank: 12) 1298880
ts mo.1440 0.238598 (rank: 4) 0.2372364 (rank: 4) 0.2349181 (rank: 4) 0.2378324 (rank: 3) 0.2366623 (rank: 4) 0.2371462 (rank: 4) 1298880
ts mo.7200 0.3134664 (rank: 8) 0.3146787 (rank: 8) 0.3119626 (rank: 8) 0.3142609 (rank: 7) 0.3136341 (rank: 8) 0.3135922 (rank: 8) 244800
ts qt.1440 0.2355912 (rank: 2) 0.2357561 (rank: 2) 0.2346795 (rank: 2) 0.234693 (rank: 1) 0.2350429 (rank: 1) 0.2351799 (rank: 2) 1298880
ts qt.7200 0.3156878 (rank: 9) 0.3167276 (rank: 9) 0.3144045 (rank: 9) 0.3168899 (rank: 8) 0.3160073 (rank: 9) 0.3159275 (rank: 9) 223200
ts wk.1440 0.2525562 (rank: 5) 0.2483678 (rank: 6) 0.2491352 (rank: 5) 0.2490372 (rank: 6) 0.2488467 (rank: 5) 0.2497741 (rank: 5) 1298880
ts wk.7200 0.2850686 (rank: 7) 0.2391797 (rank: 5) 0.3065442 (rank: 7) 0.32009 (rank: 9) 0.2886046 (rank: 7) 0.2877206 (rank: 7) 6494400
ts yr.1440 0.2357672 (rank: 3) 0.2359108 (rank: 3) 0.2349109 (rank: 3) 0.2348683 (rank: 2) 0.23523 (rank: 3) 0.2353643 (rank: 3) 1298880
ts yr.7200 0.3342637 (rank: 10) 0.3353777 (rank: 10) 0.3327021 (rank: 10) 0.335306 (rank: 10) 0.3344619 (rank: 10) 0.3344124 (rank: 10) 208800

from above models we know the βest model.

5.1.2 Interday Models

Here I summarize 1440 of 1 min data to be 1 day and choose the best fitted model. Below table compares the models.

# mse2 <- seasonal_m1 %>% 
#   ddply(.(Model, Period, index), summarise, 
#         MSE.open = mean((open.Point.Forecast - open)^2, na.rm=TRUE), 
#         MSE.high = mean((high.Point.Forecast - high)^2, na.rm=TRUE), 
#         MSE.low = mean((low.Point.Forecast - low)^2, na.rm=TRUE), 
#         MSE.close = mean((close.Point.Forecast - close)^2, na.rm=TRUE), 
#         MSE.HLC = (MSE.high + MSE.low + MSE.close)/3, 
#         MSE.OHLC = (MSE.open + MSE.high + MSE.low + MSE.close)/4, 
#         n = length(index)) %>% 
#   as_tibble

## https://tysonbarrett.com/jekyll/update/2019/10/06/datatable_memory/
## http://brooksandrew.github.io/simpleblog/articles/advanced-data-table/
seasonal_m1 <- data.table(seasonal_m1)
setorder(seasonal_m1, index)

open.accr <- seasonal_m1[, {
  open = open
  open.Point.Forecast = open.Point.Forecast
  .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
          open.smape = SMAPE(open, open.Point.Forecast), 
          open.mse = MSE(open, open.Point.Forecast), 
          open.rmse = RMSE(open, open.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

high.accr <- seasonal_m1[, {
  high = high
  high.Point.Forecast = high.Point.Forecast
  .SD[, .(.N, high.mape = MAPE(high, high.Point.Forecast), 
          high.smape = SMAPE(high, high.Point.Forecast), 
          high.mse = MSE(high, high.Point.Forecast), 
          high.rmse = RMSE(high, high.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

low.accr <- seasonal_m1[, {
  low = low
  low.Point.Forecast = low.Point.Forecast
  .SD[, .(.N, low.mape = MAPE(low, low.Point.Forecast), 
          low.smape = SMAPE(low, low.Point.Forecast), 
          low.mse = MSE(low, low.Point.Forecast), 
          low.rmse = RMSE(low, low.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

close.accr <- seasonal_m1[, {
  close = close
  close.Point.Forecast = close.Point.Forecast
  .SD[, .(.N, close.mape = MAPE(close, close.Point.Forecast), 
          close.smape = SMAPE(close, close.Point.Forecast), 
          close.mse = MSE(close, close.Point.Forecast), 
          close.rmse = RMSE(close, close.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]
open.sm <- open.accr[, list(open.mape = mean(open.mape), 
                            open.smape = mean(open.smape), 
                            open.mse = mean(open.mse), 
                            open.rmse = mean(open.rmse)), 
                       by=.(Model, Period)]

high.sm <- high.accr[, list(high.mape = mean(high.mape), 
                            high.smape = mean(high.smape), 
                            high.mse = mean(high.mse), 
                            high.rmse = mean(high.rmse)), 
                       by=.(Model, Period)]

low.sm <- low.accr[, list(low.mape = mean(low.mape), 
                          low.smape = mean(low.smape), 
                          low.mse = mean(low.mse), 
                          low.rmse = mean(low.rmse)), 
                       by=.(Model, Period)]

close.sm <- close.accr[, list(close.mape = mean(close.mape), 
                              close.smape = mean(close.smape), 
                              close.mse = mean(close.mse), 
                              close.rmse = mean(close.rmse)), 
                       by=.(Model, Period)]

daily.sm <- join_all(list(open.sm, high.sm, low.sm, close.sm)) %>% 
  tibble

saveRDS(daily.sm, 'data/fx/USDJPY/best_m.rds')

5.1.2.1 Open Price

daily.sm <- readRDS('data/fx/USDJPY/best_m.rds')

tb7 <- daily.sm %>% 
  dplyr::select(contains(c('Model', 'Period', 'open'))) %>% 
  mutate(
    open.mape = ifelse(
      rank(open.mape) <= 3, 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.smape = ifelse(
      rank(open.smape) <= 3, 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.mse = ifelse(
      rank(open.mse) <= 3, 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.rmse = ifelse(
      rank(open.rmse) <= 3, 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min Open Price Summarised to 1 Day per Unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb7
Comparison of Models (1 min Open Price Summarised to 1 Day per Unit)
Model Period open.mape open.smape open.mse open.rmse
tbats dy.qt 0.0038487 (rank: 8) 0.0038663 (rank: 8) 0.6615488 (rank: 11) 0.4836051 (rank: 8)
tbats dy.wk 0.0031178 (rank: 2) 0.0031203 (rank: 2) 0.2951857 (rank: 4) 0.4022059 (rank: 1)
tbats dy.yr 0.0078141 (rank: 12) 0.007929 (rank: 12) 3.0602275 (rank: 12) 0.9279223 (rank: 12)
ts mo.1440 0.0031302 (rank: 4) 0.0031321 (rank: 4) 0.2895257 (rank: 3) 0.4044655 (rank: 4)
ts mo.7200 0.0041186 (rank: 10) 0.0041147 (rank: 10) 0.425753 (rank: 9) 0.5564735 (rank: 10)
ts qt.1440 0.0031176 (rank: 1) 0.0031195 (rank: 1) 0.2870498 (rank: 1) 0.4030116 (rank: 2)
ts qt.7200 0.004058 (rank: 9) 0.0040546 (rank: 9) 0.42255 (rank: 8) 0.5479559 (rank: 9)
ts wk.1440 0.0032485 (rank: 7) 0.0032503 (rank: 7) 0.3038581 (rank: 5) 0.4183746 (rank: 7)
ts wk.7200 0.0031907 (rank: 6) 0.0031914 (rank: 6) 0.3388586 (rank: 7) 0.412083 (rank: 6)
ts yr.1440 0.0031196 (rank: 3) 0.0031215 (rank: 3) 0.2872197 (rank: 2) 0.4032139 (rank: 3)
ts yr.7200 0.0042881 (rank: 11) 0.0042843 (rank: 11) 0.4553046 (rank: 10) 0.5785254 (rank: 11)
tbats dy.wk.mo 0.0031517 (rank: 5) 0.003155 (rank: 5) 0.3068028 (rank: 6) 0.4058541 (rank: 5)

5.1.2.2 High Price

tb8 <- daily.sm %>% 
  dplyr::select(contains(c('Model', 'Period', 'high'))) %>% 
  mutate(
    high.mape = ifelse(
      rank(high.mape) <= 3, 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.smape = ifelse(
      rank(high.smape) <= 3, 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.mse = ifelse(
      rank(high.mse) <= 3, 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.rmse = ifelse(
      rank(high.rmse) <= 3, 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min High Price Summarised to 1 Day per Unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb8
Comparison of Models (1 min High Price Summarised to 1 Day per Unit)
Model Period high.mape high.smape high.mse high.rmse
tbats dy.qt 0.0038673 (rank: 8) 0.0038852 (rank: 8) 0.6658388 (rank: 11) 0.4855776 (rank: 8)
tbats dy.wk 0.0030783 (rank: 1) 0.0030807 (rank: 1) 0.2846739 (rank: 1) 0.397453 (rank: 1)
tbats dy.yr 0.0078297 (rank: 12) 0.0079453 (rank: 12) 3.0739678 (rank: 12) 0.9298084 (rank: 12)
ts mo.1440 0.0031371 (rank: 5) 0.0031392 (rank: 5) 0.2918493 (rank: 4) 0.4052568 (rank: 5)
ts mo.7200 0.0041905 (rank: 10) 0.0041868 (rank: 10) 0.4366597 (rank: 9) 0.5650381 (rank: 10)
ts qt.1440 0.0031227 (rank: 3) 0.0031248 (rank: 3) 0.288908 (rank: 2) 0.4035778 (rank: 3)
ts qt.7200 0.004129 (rank: 9) 0.0041259 (rank: 9) 0.4333607 (rank: 8) 0.5565739 (rank: 9)
ts wk.1440 0.0032312 (rank: 7) 0.0032334 (rank: 7) 0.3002029 (rank: 6) 0.4159632 (rank: 7)
ts wk.7200 0.0031119 (rank: 2) 0.0031138 (rank: 2) 0.2986969 (rank: 5) 0.401548 (rank: 2)
ts yr.1440 0.0031252 (rank: 4) 0.0031273 (rank: 4) 0.2890714 (rank: 3) 0.4038346 (rank: 4)
ts yr.7200 0.0043671 (rank: 11) 0.0043636 (rank: 11) 0.467057 (rank: 10) 0.5881937 (rank: 11)
tbats dy.wk.mo 0.0031592 (rank: 6) 0.0031622 (rank: 6) 0.3054827 (rank: 7) 0.4065748 (rank: 6)

5.1.2.3 Low Price

tb9 <- daily.sm %>% 
  dplyr::select(contains(c('Model', 'Period', 'low'))) %>% 
  mutate(
    low.mape = ifelse(
      rank(low.mape) <= 3, 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.smape = ifelse(
      rank(low.smape) <= 3, 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.mse = ifelse(
      rank(low.mse) <= 3, 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.rmse = ifelse(
      rank(low.rmse) <= 3, 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min Open Price Summarised to 1 Day per Unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb9
Comparison of Models (1 min Open Price Summarised to 1 Day per Unit)
Model Period low.mape low.smape low.mse low.rmse
tbats dy.qt 0.0038604 (rank: 8) 0.0038777 (rank: 8) 0.6593377 (rank: 11) 0.4847373 (rank: 8)
tbats dy.wk 0.0030658 (rank: 1) 0.0030678 (rank: 1) 0.2820305 (rank: 1) 0.3962719 (rank: 1)
tbats dy.yr 0.0078086 (rank: 12) 0.0079229 (rank: 12) 3.0492512 (rank: 12) 0.9272861 (rank: 12)
ts mo.1440 0.0031155 (rank: 3) 0.0031171 (rank: 3) 0.2833452 (rank: 4) 0.4027251 (rank: 3)
ts mo.7200 0.0040769 (rank: 10) 0.0040725 (rank: 10) 0.4221267 (rank: 9) 0.5517966 (rank: 10)
ts qt.1440 0.0031147 (rank: 2) 0.0031162 (rank: 2) 0.2829726 (rank: 2) 0.4026439 (rank: 2)
ts qt.7200 0.0039968 (rank: 9) 0.0039929 (rank: 9) 0.4190357 (rank: 8) 0.5412921 (rank: 9)
ts wk.1440 0.0032298 (rank: 6) 0.0032312 (rank: 6) 0.2968221 (rank: 5) 0.4159053 (rank: 6)
ts wk.7200 0.0032465 (rank: 7) 0.0032471 (rank: 7) 0.3657361 (rank: 7) 0.4186519 (rank: 7)
ts yr.1440 0.0031173 (rank: 4) 0.0031188 (rank: 4) 0.2831797 (rank: 3) 0.4029436 (rank: 4)
ts yr.7200 0.0042393 (rank: 11) 0.004235 (rank: 11) 0.4522995 (rank: 10) 0.5732734 (rank: 11)
tbats dy.wk.mo 0.0031814 (rank: 5) 0.0031842 (rank: 5) 0.3030913 (rank: 6) 0.4089394 (rank: 5)

5.1.2.4 Close Price

tb10 <- daily.sm %>% 
  dplyr::select(contains(c('Model', 'Period', 'close'))) %>% 
  mutate(
    close.mape = ifelse(
      rank(close.mape) <= 3, 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.smape = ifelse(
      rank(close.smape) <= 3, 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.mse = ifelse(
      rank(close.mse) <= 3, 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.rmse = ifelse(
      rank(close.rmse) <= 3, 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min Close Price Summarised to 1 Day per Unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb10
Comparison of Models (1 min Close Price Summarised to 1 Day per Unit)
Model Period close.mape close.smape close.mse close.rmse
tbats dy.qt 0.0038503 (rank: 8) 0.0038679 (rank: 8) 0.6610232 (rank: 11) 0.4837561 (rank: 8)
tbats dy.wk 0.003145 (rank: 5) 0.0031473 (rank: 5) 0.3015154 (rank: 6) 0.4057309 (rank: 5)
tbats dy.yr 0.0078135 (rank: 12) 0.0079289 (rank: 12) 3.0682874 (rank: 12) 0.9280099 (rank: 12)
ts mo.1440 0.0031304 (rank: 4) 0.003132 (rank: 4) 0.2874381 (rank: 3) 0.4044561 (rank: 4)
ts mo.7200 0.0041607 (rank: 10) 0.0041564 (rank: 10) 0.4379246 (rank: 9) 0.5616704 (rank: 10)
ts qt.1440 0.0031164 (rank: 1) 0.0031182 (rank: 1) 0.284739 (rank: 1) 0.4028578 (rank: 2)
ts qt.7200 0.0040893 (rank: 9) 0.0040855 (rank: 9) 0.4356525 (rank: 8) 0.5524039 (rank: 9)
ts wk.1440 0.0032319 (rank: 7) 0.0032337 (rank: 7) 0.2995034 (rank: 5) 0.4162795 (rank: 7)
ts wk.7200 0.0031979 (rank: 6) 0.0031966 (rank: 6) 0.3632592 (rank: 7) 0.4118763 (rank: 6)
ts yr.1440 0.0031187 (rank: 2) 0.0031205 (rank: 2) 0.2849251 (rank: 2) 0.403099 (rank: 3)
ts yr.7200 0.0043391 (rank: 11) 0.0043348 (rank: 11) 0.4701278 (rank: 10) 0.5850767 (rank: 11)
tbats dy.wk.mo 0.0031204 (rank: 3) 0.0031234 (rank: 3) 0.2948921 (rank: 4) 0.4018679 (rank: 1)

5.1.2.5 Summary

tb11 <- daily.sm %>% 
  mutate(
    open.mape = ifelse(
      rank(open.mape) <= 3, 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.smape = ifelse(
      rank(open.smape) <= 3, 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.mse = ifelse(
      rank(open.mse) <= 3, 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.rmse = ifelse(
      rank(open.rmse) <= 3, 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    high.mape = ifelse(
      rank(high.mape) <= 3, 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.smape = ifelse(
      rank(high.smape) <= 3, 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.mse = ifelse(
      rank(high.mse) <= 3, 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.rmse = ifelse(
      rank(high.rmse) <= 3, 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    low.mape = ifelse(
      rank(low.mape) <= 3, 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.smape = ifelse(
      rank(low.smape) <= 3, 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.mse = ifelse(
      rank(low.mse) <= 3, 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.rmse = ifelse(
      rank(low.rmse) <= 3, 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    close.mape = ifelse(
      rank(close.mape) <= 3, 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.smape = ifelse(
      rank(close.smape) <= 3, 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.mse = ifelse(
      rank(close.mse) <= 3, 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.rmse = ifelse(
      rank(close.rmse) <= 3, 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min summarised to 1 day per unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  #column_spec(3, background = 'LightSlateGrey') %>% 
  column_spec(3, background = 'LightGray') %>% 
  column_spec(4, background = 'Gainsboro') %>% 
  column_spec(5, background = 'LightGray') %>%   
  column_spec(6, background = 'Gainsboro') %>% 
  column_spec(7, background = 'LightGray') %>% 
  column_spec(8, background = 'Gainsboro') %>% 
  column_spec(9, background = 'LightGray') %>%   
  column_spec(10, background = 'Gainsboro') %>% 
  column_spec(11, background = 'LightGray') %>% 
  column_spec(12, background = 'Gainsboro') %>% 
  column_spec(13, background = 'LightGray') %>%   
  column_spec(14, background = 'Gainsboro') %>% 
  column_spec(15, background = 'LightGray') %>% 
  column_spec(16, background = 'Gainsboro') %>% 
  column_spec(17, background = 'LightGray') %>%   
  column_spec(18, background = 'Gainsboro') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb11
Comparison of Models (1 min summarised to 1 day per unit)
Model Period open.mape open.smape open.mse open.rmse high.mape high.smape high.mse high.rmse low.mape low.smape low.mse low.rmse close.mape close.smape close.mse close.rmse
tbats dy.qt 0.0038487 (rank: 8) 0.0038663 (rank: 8) 0.6615488 (rank: 11) 0.4836051 (rank: 8) 0.0038673 (rank: 8) 0.0038852 (rank: 8) 0.6658388 (rank: 11) 0.4855776 (rank: 8) 0.0038604 (rank: 8) 0.0038777 (rank: 8) 0.6593377 (rank: 11) 0.4847373 (rank: 8) 0.0038503 (rank: 8) 0.0038679 (rank: 8) 0.6610232 (rank: 11) 0.4837561 (rank: 8)
tbats dy.wk 0.0031178 (rank: 2) 0.0031203 (rank: 2) 0.2951857 (rank: 4) 0.4022059 (rank: 1) 0.0030783 (rank: 1) 0.0030807 (rank: 1) 0.2846739 (rank: 1) 0.397453 (rank: 1) 0.0030658 (rank: 1) 0.0030678 (rank: 1) 0.2820305 (rank: 1) 0.3962719 (rank: 1) 0.003145 (rank: 5) 0.0031473 (rank: 5) 0.3015154 (rank: 6) 0.4057309 (rank: 5)
tbats dy.yr 0.0078141 (rank: 12) 0.007929 (rank: 12) 3.0602275 (rank: 12) 0.9279223 (rank: 12) 0.0078297 (rank: 12) 0.0079453 (rank: 12) 3.0739678 (rank: 12) 0.9298084 (rank: 12) 0.0078086 (rank: 12) 0.0079229 (rank: 12) 3.0492512 (rank: 12) 0.9272861 (rank: 12) 0.0078135 (rank: 12) 0.0079289 (rank: 12) 3.0682874 (rank: 12) 0.9280099 (rank: 12)
ts mo.1440 0.0031302 (rank: 4) 0.0031321 (rank: 4) 0.2895257 (rank: 3) 0.4044655 (rank: 4) 0.0031371 (rank: 5) 0.0031392 (rank: 5) 0.2918493 (rank: 4) 0.4052568 (rank: 5) 0.0031155 (rank: 3) 0.0031171 (rank: 3) 0.2833452 (rank: 4) 0.4027251 (rank: 3) 0.0031304 (rank: 4) 0.003132 (rank: 4) 0.2874381 (rank: 3) 0.4044561 (rank: 4)
ts mo.7200 0.0041186 (rank: 10) 0.0041147 (rank: 10) 0.425753 (rank: 9) 0.5564735 (rank: 10) 0.0041905 (rank: 10) 0.0041868 (rank: 10) 0.4366597 (rank: 9) 0.5650381 (rank: 10) 0.0040769 (rank: 10) 0.0040725 (rank: 10) 0.4221267 (rank: 9) 0.5517966 (rank: 10) 0.0041607 (rank: 10) 0.0041564 (rank: 10) 0.4379246 (rank: 9) 0.5616704 (rank: 10)
ts qt.1440 0.0031176 (rank: 1) 0.0031195 (rank: 1) 0.2870498 (rank: 1) 0.4030116 (rank: 2) 0.0031227 (rank: 3) 0.0031248 (rank: 3) 0.288908 (rank: 2) 0.4035778 (rank: 3) 0.0031147 (rank: 2) 0.0031162 (rank: 2) 0.2829726 (rank: 2) 0.4026439 (rank: 2) 0.0031164 (rank: 1) 0.0031182 (rank: 1) 0.284739 (rank: 1) 0.4028578 (rank: 2)
ts qt.7200 0.004058 (rank: 9) 0.0040546 (rank: 9) 0.42255 (rank: 8) 0.5479559 (rank: 9) 0.004129 (rank: 9) 0.0041259 (rank: 9) 0.4333607 (rank: 8) 0.5565739 (rank: 9) 0.0039968 (rank: 9) 0.0039929 (rank: 9) 0.4190357 (rank: 8) 0.5412921 (rank: 9) 0.0040893 (rank: 9) 0.0040855 (rank: 9) 0.4356525 (rank: 8) 0.5524039 (rank: 9)
ts wk.1440 0.0032485 (rank: 7) 0.0032503 (rank: 7) 0.3038581 (rank: 5) 0.4183746 (rank: 7) 0.0032312 (rank: 7) 0.0032334 (rank: 7) 0.3002029 (rank: 6) 0.4159632 (rank: 7) 0.0032298 (rank: 6) 0.0032312 (rank: 6) 0.2968221 (rank: 5) 0.4159053 (rank: 6) 0.0032319 (rank: 7) 0.0032337 (rank: 7) 0.2995034 (rank: 5) 0.4162795 (rank: 7)
ts wk.7200 0.0031907 (rank: 6) 0.0031914 (rank: 6) 0.3388586 (rank: 7) 0.412083 (rank: 6) 0.0031119 (rank: 2) 0.0031138 (rank: 2) 0.2986969 (rank: 5) 0.401548 (rank: 2) 0.0032465 (rank: 7) 0.0032471 (rank: 7) 0.3657361 (rank: 7) 0.4186519 (rank: 7) 0.0031979 (rank: 6) 0.0031966 (rank: 6) 0.3632592 (rank: 7) 0.4118763 (rank: 6)
ts yr.1440 0.0031196 (rank: 3) 0.0031215 (rank: 3) 0.2872197 (rank: 2) 0.4032139 (rank: 3) 0.0031252 (rank: 4) 0.0031273 (rank: 4) 0.2890714 (rank: 3) 0.4038346 (rank: 4) 0.0031173 (rank: 4) 0.0031188 (rank: 4) 0.2831797 (rank: 3) 0.4029436 (rank: 4) 0.0031187 (rank: 2) 0.0031205 (rank: 2) 0.2849251 (rank: 2) 0.403099 (rank: 3)
ts yr.7200 0.0042881 (rank: 11) 0.0042843 (rank: 11) 0.4553046 (rank: 10) 0.5785254 (rank: 11) 0.0043671 (rank: 11) 0.0043636 (rank: 11) 0.467057 (rank: 10) 0.5881937 (rank: 11) 0.0042393 (rank: 11) 0.004235 (rank: 11) 0.4522995 (rank: 10) 0.5732734 (rank: 11) 0.0043391 (rank: 11) 0.0043348 (rank: 11) 0.4701278 (rank: 10) 0.5850767 (rank: 11)
tbats dy.wk.mo 0.0031517 (rank: 5) 0.003155 (rank: 5) 0.3068028 (rank: 6) 0.4058541 (rank: 5) 0.0031592 (rank: 6) 0.0031622 (rank: 6) 0.3054827 (rank: 7) 0.4065748 (rank: 6) 0.0031814 (rank: 5) 0.0031842 (rank: 5) 0.3030913 (rank: 6) 0.4089394 (rank: 5) 0.0031204 (rank: 3) 0.0031234 (rank: 3) 0.2948921 (rank: 4) 0.4018679 (rank: 1)

Above table summarized the daily mape, smape, mse and rmse values and then summarized again the models (which is nested summarize due to daily settlement), we can interpret from above table :

  • Weekly or 7200 mins length’s dataset with msts(seasonal.periods = c(1440, 7200)) %>% tbats %>% forecast(h = 1440).
  • Quarterly length’s dataset with tk_ts(frequency = 1440) %>% forecast(h=1440).
  • Annum length’s dataset with tk_ts(frequency = 1440) %>% forecast(h=1440).

5.1.3 Miscellaneous

5.1.3.1 Best Model

#best_model <- seasonal_m1 %>% 
#    ddply(.(Model, Period), summarize, 
#        mape = MAPE(open, open.Point.Forecast), 
#        smape = SMAPE(open, open.Point.Forecast), 
#        mse = MSE(open, open.Point.Forecast), 
#        rmse = RMSE(open, open.Point.Forecast))

## https://tysonbarrett.com/jekyll/update/2019/10/06/datatable_memory/
## http://brooksandrew.github.io/simpleblog/articles/advanced-data-table/
if(!is.data.table(seasonal_m1)) seasonal_m1 <- data.table(seasonal_m1)
setorder(seasonal_m1, index)

m.op <- seasonal_m1[, {
  open = open
  open.Point.Forecast = open.Point.Forecast
  .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
          open.smape = SMAPE(open, open.Point.Forecast), 
          open.mse = MSE(open, open.Point.Forecast), 
          open.rmse = RMSE(open, open.Point.Forecast)), 
      by=.(Model, Period)]}][order(Model, Period), ]

m.hi <- seasonal_m1[, {
  high = high
  high.Point.Forecast = high.Point.Forecast
  .SD[, .(.N, high.mape = MAPE(high, high.Point.Forecast), 
          high.smape = SMAPE(high, high.Point.Forecast), 
          high.mse = MSE(high, high.Point.Forecast), 
          high.rmse = RMSE(high, high.Point.Forecast)), 
      by=.(Model, Period)]}][order(Model, Period), ]

m.lo <- seasonal_m1[, {
  low = low
  low.Point.Forecast = low.Point.Forecast
  .SD[, .(.N, low.mape = MAPE(low, low.Point.Forecast), 
          low.smape = SMAPE(low, low.Point.Forecast), 
          low.mse = MSE(low, low.Point.Forecast), 
          low.rmse = RMSE(low, low.Point.Forecast)), 
      by=.(Model, Period)]}][order(Model, Period), ]

m.cl <- seasonal_m1[, {
  close = close
  close.Point.Forecast = close.Point.Forecast
  .SD[, .(.N, close.mape = MAPE(close, close.Point.Forecast), 
          close.smape = SMAPE(close, close.Point.Forecast), 
          close.mse = MSE(close, close.Point.Forecast), 
          close.rmse = RMSE(close, close.Point.Forecast)), 
      by=.(Model, Period)]}][order(Model, Period), ]

best_model <- join_all(list(m.op, m.hi, m.lo, m.cl)) %>% tibble
saveRDS(best_model, 'data/fx/USDJPY/best_m_daily.rds')
rm(m.op, m.hi, m.lo, m.cl)
best_model <- readRDS('data/fx/USDJPY/best_m_daily.rds')

tb12 <- best_model %>% 
  mutate(
    open.mape = ifelse(
      rank(open.mape) <= 3, 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.smape = ifelse(
      rank(open.smape) <= 3, 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.mse = ifelse(
      rank(open.mse) <= 3, 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.rmse = ifelse(
      rank(open.rmse) <= 3, 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    high.mape = ifelse(
      rank(high.mape) <= 3, 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.smape = ifelse(
      rank(high.smape) <= 3, 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.mse = ifelse(
      rank(high.mse) <= 3, 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.rmse = ifelse(
      rank(high.rmse) <= 3, 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    low.mape = ifelse(
      rank(low.mape) <= 3, 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.smape = ifelse(
      rank(low.smape) <= 3, 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.mse = ifelse(
      rank(low.mse) <= 3, 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.rmse = ifelse(
      rank(low.rmse) <= 3, 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    close.mape = ifelse(
      rank(close.mape) <= 3, 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.smape = ifelse(
      rank(close.smape) <= 3, 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.mse = ifelse(
      rank(close.mse) <= 3, 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.rmse = ifelse(
      rank(close.rmse) <= 3, 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'LightSlateGrey') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  column_spec(7, background = 'Gainsboro') %>% 
  column_spec(8, background = 'LightGray') %>% 
  column_spec(9, background = 'Gainsboro') %>% 
  column_spec(10, background = 'LightGray') %>%   
  column_spec(11, background = 'Gainsboro') %>% 
  column_spec(12, background = 'LightGray') %>% 
  column_spec(13, background = 'Gainsboro') %>% 
  column_spec(14, background = 'LightGray') %>%   
  column_spec(15, background = 'Gainsboro') %>% 
  column_spec(16, background = 'LightGray') %>% 
  column_spec(17, background = 'Gainsboro') %>% 
  column_spec(18, background = 'LightGray') %>%   
  column_spec(19, background = 'Gainsboro') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb12
Comparison of Models
Model Period N open.mape open.smape open.mse open.rmse high.mape high.smape high.mse high.rmse low.mape low.smape low.mse low.rmse close.mape close.smape close.mse close.rmse
tbats dy.qt 1298880 0.0035608 (rank: 10) 0.0035773 (rank: 10) 0.5935084 (rank: 11) 0.770395 (rank: 11) 0.0035672 (rank: 10) 0.0035837 (rank: 10) 0.5946396 (rank: 11) 0.7711288 (rank: 11) 0.0035692 (rank: 10) 0.0035856 (rank: 10) 0.593577 (rank: 11) 0.7704395 (rank: 11) 0.0035606 (rank: 10) 0.0035771 (rank: 10) 0.59344 (rank: 11) 0.7703506 (rank: 11)
tbats dy.wk 1298880 0.002821 (rank: 1) 0.0028228 (rank: 1) 0.2331241 (rank: 1) 0.4828292 (rank: 1) 0.0027999 (rank: 1) 0.0028016 (rank: 1) 0.2305384 (rank: 1) 0.4801442 (rank: 1) 0.0028014 (rank: 1) 0.0028031 (rank: 1) 0.2331357 (rank: 1) 0.4828412 (rank: 1) 0.002839 (rank: 1) 0.002841 (rank: 1) 0.2415673 (rank: 4) 0.4914949 (rank: 4)
tbats dy.wk.mo 1287360 0.0028932 (rank: 5) 0.0028962 (rank: 5) 0.2585134 (rank: 6) 0.5084421 (rank: 6) 0.002889 (rank: 6) 0.0028914 (rank: 6) 0.2531527 (rank: 7) 0.5031428 (rank: 7) 0.0029032 (rank: 5) 0.0029056 (rank: 5) 0.2511519 (rank: 6) 0.5011506 (rank: 6) 0.0028635 (rank: 4) 0.0028661 (rank: 4) 0.2468493 (rank: 5) 0.4968393 (rank: 5)
tbats dy.yr 1298880 0.0075387 (rank: 12) 0.0076525 (rank: 12) 2.992332 (rank: 12) 1.7298358 (rank: 12) 0.0075476 (rank: 12) 0.0076617 (rank: 12) 3.0002451 (rank: 12) 1.7321216 (rank: 12) 0.0075415 (rank: 12) 0.0076552 (rank: 12) 2.989127 (rank: 12) 1.7289092 (rank: 12) 0.0075423 (rank: 12) 0.0076565 (rank: 12) 3.0017416 (rank: 12) 1.7325535 (rank: 12)
ts mo.1440 1298880 0.002871 (rank: 4) 0.0028723 (rank: 4) 0.238598 (rank: 4) 0.4884649 (rank: 4) 0.0028638 (rank: 5) 0.0028652 (rank: 5) 0.2372364 (rank: 4) 0.4870692 (rank: 4) 0.0028605 (rank: 3) 0.0028618 (rank: 3) 0.2349181 (rank: 4) 0.4846835 (rank: 4) 0.0028733 (rank: 5) 0.0028745 (rank: 5) 0.2378324 (rank: 3) 0.4876807 (rank: 3)
ts mo.7200 244800 0.0034764 (rank: 8) 0.0034756 (rank: 8) 0.3134664 (rank: 8) 0.5598807 (rank: 8) 0.0035018 (rank: 8) 0.0035011 (rank: 8) 0.3146787 (rank: 8) 0.5609623 (rank: 8) 0.0034669 (rank: 8) 0.0034659 (rank: 8) 0.3119626 (rank: 8) 0.5585361 (rank: 8) 0.0034906 (rank: 8) 0.0034897 (rank: 8) 0.3142609 (rank: 7) 0.5605898 (rank: 7)
ts qt.1440 1298880 0.0028558 (rank: 2) 0.0028571 (rank: 2) 0.2355912 (rank: 2) 0.4853773 (rank: 2) 0.0028566 (rank: 3) 0.002858 (rank: 3) 0.2357561 (rank: 2) 0.4855472 (rank: 2) 0.0028598 (rank: 2) 0.0028611 (rank: 2) 0.2346795 (rank: 2) 0.4844374 (rank: 2) 0.0028572 (rank: 2) 0.0028585 (rank: 2) 0.234693 (rank: 1) 0.4844512 (rank: 1)
ts qt.7200 223200 0.0034844 (rank: 9) 0.0034841 (rank: 9) 0.3156878 (rank: 9) 0.561861 (rank: 9) 0.0035078 (rank: 9) 0.0035075 (rank: 9) 0.3167276 (rank: 9) 0.5627856 (rank: 9) 0.0034754 (rank: 9) 0.003475 (rank: 9) 0.3144045 (rank: 9) 0.5607179 (rank: 9) 0.0034988 (rank: 9) 0.0034984 (rank: 9) 0.3168899 (rank: 8) 0.5629298 (rank: 8)
ts wk.1440 1298880 0.0029887 (rank: 7) 0.0029899 (rank: 7) 0.2525562 (rank: 5) 0.5025497 (rank: 5) 0.0029757 (rank: 7) 0.0029772 (rank: 7) 0.2483678 (rank: 6) 0.4983651 (rank: 6) 0.0029796 (rank: 7) 0.0029807 (rank: 7) 0.2491352 (rank: 5) 0.4991344 (rank: 5) 0.0029779 (rank: 7) 0.0029791 (rank: 7) 0.2490372 (rank: 6) 0.4990362 (rank: 6)
ts wk.7200 6494400 0.0029027 (rank: 6) 0.002903 (rank: 6) 0.2850686 (rank: 7) 0.5339181 (rank: 7) 0.0028179 (rank: 2) 0.0028195 (rank: 2) 0.2391797 (rank: 5) 0.48906 (rank: 5) 0.00295 (rank: 6) 0.0029496 (rank: 6) 0.3065442 (rank: 7) 0.5536644 (rank: 7) 0.0029287 (rank: 6) 0.0029266 (rank: 6) 0.32009 (rank: 9) 0.565765 (rank: 9)
ts yr.1440 1298880 0.0028579 (rank: 3) 0.0028593 (rank: 3) 0.2357672 (rank: 3) 0.4855587 (rank: 3) 0.0028589 (rank: 4) 0.0028603 (rank: 4) 0.2359108 (rank: 3) 0.4857065 (rank: 3) 0.0028625 (rank: 4) 0.0028637 (rank: 4) 0.2349109 (rank: 3) 0.484676 (rank: 3) 0.0028594 (rank: 3) 0.0028607 (rank: 3) 0.2348683 (rank: 2) 0.4846321 (rank: 2)
ts yr.7200 208800 0.0036239 (rank: 11) 0.0036236 (rank: 11) 0.3342637 (rank: 10) 0.5781554 (rank: 10) 0.0036485 (rank: 11) 0.0036482 (rank: 11) 0.3353777 (rank: 10) 0.5791181 (rank: 10) 0.0036111 (rank: 11) 0.0036106 (rank: 11) 0.3327021 (rank: 10) 0.5768033 (rank: 10) 0.0036356 (rank: 11) 0.0036352 (rank: 11) 0.335306 (rank: 10) 0.5790561 (rank: 10)

Above table summarized the total observations with mape, smape, mse and rmse values (which is not nested summarize not daily settlement for P&L), we can interpret from above table :

  • Weekly or 7200 mins length’s dataset with msts(seasonal.periods = c(1440, 7200)) %>% tbats %>% forecast(h = 1440).
  • Quarterly length’s dataset with tk_ts(frequency = 1440) %>% forecast(h=1440).
  • Annum length’s dataset with tk_ts(frequency = 1440) %>% forecast(h=1440).

5.1.3.2 Sarima

##Below model use open price dataset where contain 7200 mins and forecast 1440 mins.
fit_ts <- readRDS('data/fx/USDJPY/sarima_ts_sample.rds')
#fr_ts <- forecast(fit_ts, h = 1440)
fr_ts <- readRDS('data/fx/USDJPY/sarima_frts_sample.rds')
fr_ts.sample <- readRDS('data/fx/USDJPY/fr_ts.sample.wk.1440.2015-01-12.rds')

##Below model use open price dataset where contain 7200 mins and forecast nested 60mins & 1440 mins.
fit_msts <- readRDS('data/fx/USDJPY/sarima_msts_sample.rds')
fr_msts <- readRDS('data/fx/USDJPY/sarima_frmsts_sample.rds')
fr_msts.sample <- readRDS('data/fx/USDJPY/fr_msts.sample.wk.1440.2015-01-12.rds')

Due to heavily calculation on sarima models, here I only use 1st week from 2015-01-12 00:01:00 to from 2015-01-13 00:00:00` calculate.

cmp1 <- join(fr_ts.sample, fr_msts.sample) %>% 
  as_tibble

lst1 <- list.files('data/fx/USDJPY', pattern = '^mts.*.2015-01-12.rds$')
cmp2 <- llply(lst1, function(x) {
    readRDS(paste0('data/fx/USDJPY/', x)) %>% 
    dplyr::select(contains(c('index', 'open.Point.Forecast'))) %>% .[,1:2]
  })
names(cmp2) <- str_replace_all(lst1, '.[1-9].*', '')
cmp2 %<>% ldply %>% 
  as_tibble %>% 
  spread(.id, open.Point.Forecast)
cmp2 <- data.frame(open = cmp1$open, cmp2) %>% 
  as_tibble %>% 
  .[c(2:1, 3:ncol(.))]

lst2 <- list.files('data/fx/USDJPY', pattern = '^sets.*.2015-01-12.rds$')
cmp3 <- llply(lst2, function(x) {
    readRDS(paste0('data/fx/USDJPY/', x))$forecast %>% 
    dplyr::select(contains(c('index', 'open.Point.Forecast'))) %>% .[1:1440,1:2]
  })
names(cmp3) <- substr(lst2, 1, 12) #manual filter characters
cmp3 %<>% ldply %>% 
  as_tibble %>% 
  spread(.id, open.Point.Forecast)
cmp3 <- data.frame(open = cmp1$open, cmp3) %>% 
  as_tibble %>% 
  .[c(2:1, 3:ncol(.))]

## ------------------------
cmp1 <- data.frame(
  Model = c('sarima_ts', 'sarima_msts'), 
  n = nrow(cmp1), 
  mape = c(MAPE(cmp1$open, cmp1$sarima_ts), 
           MAPE(cmp1$open, cmp1$sarima_msts)), 
  smape = c(SMAPE(cmp1$open, cmp1$sarima_ts), 
            SMAPE(cmp1$open, cmp1$sarima_msts)), 
  mse = c(MSE(cmp1$open, cmp1$sarima_ts), 
          MSE(cmp1$open, cmp1$sarima_msts)), 
  rmse = c(RMSE(cmp1$open, cmp1$sarima_ts), 
           RMSE(cmp1$open, cmp1$sarima_msts))) %>% 
  tibble

cmp2 <- data.frame(
  Model = names(cmp2)[3:ncol(cmp2)], 
  n = nrow(cmp2), 
  mape = c(MAPE(cmp2$open, cmp2$mts.dy.qt), 
           MAPE(cmp2$open, cmp2$mts.dy.wk), 
           MAPE(cmp2$open, cmp2$mts.dy.wk.mo), 
           MAPE(cmp2$open, cmp2$mts.dy.yr)), 
  smape = c(SMAPE(cmp2$open, cmp2$mts.dy.qt), 
            SMAPE(cmp2$open, cmp2$mts.dy.wk), 
            SMAPE(cmp2$open, cmp2$mts.dy.wk.mo), 
            SMAPE(cmp2$open, cmp2$mts.dy.yr)), 
  mse = c(MSE(cmp2$open, cmp2$mts.dy.qt), 
          MSE(cmp2$open, cmp2$mts.dy.wk), 
          MSE(cmp2$open, cmp2$mts.dy.wk.mo), 
          MSE(cmp2$open, cmp2$mts.dy.yr)), 
  rmse = c(RMSE(cmp2$open, cmp2$mts.dy.qt), 
           RMSE(cmp2$open, cmp2$mts.dy.wk), 
           RMSE(cmp2$open, cmp2$mts.dy.wk.mo), 
           RMSE(cmp2$open, cmp2$mts.dy.yr))) %>% 
  tibble

cmp3 <- data.frame(
  Model = names(cmp3)[3:ncol(cmp3)], 
  n = nrow(cmp3), 
  mape = c(MAPE(cmp3$open, cmp3$sets.mo.1440), 
           MAPE(cmp3$open, cmp3$sets.mo.7200), 
           MAPE(cmp3$open, cmp3$sets.qt.1440), 
           MAPE(cmp3$open, cmp3$sets.qt.7200), 
           MAPE(cmp3$open, cmp3$sets.wk.1440), 
           MAPE(cmp3$open, cmp3$sets.wk.7200), 
           MAPE(cmp3$open, cmp3$sets.yr.1440), 
           MAPE(cmp3$open, cmp3$sets.yr.7200)), 
  smape = c(SMAPE(cmp3$open, cmp3$sets.mo.1440), 
            SMAPE(cmp3$open, cmp3$sets.mo.7200), 
            SMAPE(cmp3$open, cmp3$sets.qt.1440), 
            SMAPE(cmp3$open, cmp3$sets.qt.7200), 
            SMAPE(cmp3$open, cmp3$sets.wk.1440), 
            SMAPE(cmp3$open, cmp3$sets.wk.7200), 
            SMAPE(cmp3$open, cmp3$sets.yr.1440), 
            SMAPE(cmp3$open, cmp3$sets.yr.7200)), 
  mse = c(MSE(cmp3$open, cmp3$sets.mo.1440), 
          MSE(cmp3$open, cmp3$sets.mo.7200), 
          MSE(cmp3$open, cmp3$sets.qt.1440), 
          MSE(cmp3$open, cmp3$sets.qt.7200), 
          MSE(cmp3$open, cmp3$sets.wk.1440), 
          MSE(cmp3$open, cmp3$sets.wk.7200), 
          MSE(cmp3$open, cmp3$sets.yr.1440), 
          MSE(cmp3$open, cmp3$sets.yr.7200)), 
  rmse = c(RMSE(cmp3$open, cmp3$sets.mo.1440), 
           RMSE(cmp3$open, cmp3$sets.mo.7200), 
           RMSE(cmp3$open, cmp3$sets.qt.1440), 
           RMSE(cmp3$open, cmp3$sets.qt.7200), 
           RMSE(cmp3$open, cmp3$sets.wk.1440), 
           RMSE(cmp3$open, cmp3$sets.wk.7200), 
           RMSE(cmp3$open, cmp3$sets.yr.1440), 
           RMSE(cmp3$open, cmp3$sets.yr.7200))) %>% 
  tibble

cmp <- bind_rows(cmp1, cmp2, cmp3) %>% 
  as_tibble
tb13 <- cmp %>% 
  mutate(
    mape = ifelse(
      rank(mape) <= 3, 
      cell_spec(
        paste0(round(mape, 7), ' (rank: ', sprintf('%1.f', rank(mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(mape, 7), ' (rank: ', sprintf('%1.f', rank(mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    smape = ifelse(
      rank(smape) <= 3, 
      cell_spec(
        paste0(round(smape, 7), ' (rank: ', sprintf('%1.f', rank(smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(smape, 7), ' (rank: ', sprintf('%1.f', rank(smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    mse = ifelse(
      rank(mse) <= 3, 
      cell_spec(
        paste0(round(mse, 7), ' (rank: ', sprintf('%1.f', rank(mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(mse, 7), ' (rank: ', sprintf('%1.f', rank(mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    rmse = ifelse(
      rank(rmse) <= 3, 
      cell_spec(
        paste0(round(rmse, 7), ' (rank: ', sprintf('%1.f', rank(rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(rmse, 7), ' (rank: ', sprintf('%1.f', rank(rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Sarima_ts & Sarima_msts Models etc', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'Gainsboro') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb13
Comparison of Sarima_ts & Sarima_msts Models etc
Model n mape smape mse rmse
sarima_ts 1440 0.0046041 (rank: 12) 0.0045896 (rank: 12) 0.4452853 (rank: 12) 0.667297 (rank: 12)
sarima_msts 1440 0.0046041 (rank: 12) 0.0045896 (rank: 12) 0.4452853 (rank: 12) 0.667297 (rank: 12)
mts.dy.qt 1440 0.0024737 (rank: 6) 0.0024726 (rank: 6) 0.1155722 (rank: 6) 0.3399591 (rank: 6)
mts.dy.wk 1440 0.0024737 (rank: 6) 0.0024726 (rank: 6) 0.1155722 (rank: 6) 0.3399591 (rank: 6)
mts.dy.wk.mo 1440 NA (rank: 14) NA (rank: 14) NA (rank: 14) NA (rank: 14)
mts.dy.yr 1440 0.0024737 (rank: 6) 0.0024726 (rank: 6) 0.1155722 (rank: 6) 0.3399591 (rank: 6)
sets.mo.1440 1440 0.0026197 (rank: 10) 0.0026221 (rank: 10) 0.1198407 (rank: 10) 0.3461801 (rank: 10)
sets.mo.7200 1440 0.0024737 (rank: 2) 0.0024726 (rank: 2) 0.1155722 (rank: 2) 0.3399591 (rank: 2)
sets.qt.1440 1440 0.0026197 (rank: 10) 0.0026221 (rank: 10) 0.1198407 (rank: 10) 0.3461801 (rank: 10)
sets.qt.7200 1440 0.0024737 (rank: 2) 0.0024726 (rank: 2) 0.1155722 (rank: 2) 0.3399591 (rank: 2)
sets.wk.1440 1440 0.0026197 (rank: 10) 0.0026221 (rank: 10) 0.1198407 (rank: 10) 0.3461801 (rank: 10)
sets.wk.7200 1440 0.0024737 (rank: 2) 0.0024726 (rank: 2) 0.1155722 (rank: 2) 0.3399591 (rank: 2)
sets.yr.1440 1440 0.0026197 (rank: 10) 0.0026221 (rank: 10) 0.1198407 (rank: 10) 0.3461801 (rank: 10)
sets.yr.7200 1440 0.0024737 (rank: 2) 0.0024726 (rank: 2) 0.1155722 (rank: 2) 0.3399591 (rank: 2)

Application of auto.arima() on both ts() and msts() seasonal datasets compare the ts() and msts() sarima models.

5.2 1 day per unit

5.2.1 Interday ETS Model

Below I recall the ETS models for interday price prediction in previous paper for comparison.

ets.fls <- list.files('data', pattern = '^[A-Z]{3}\\.[A-Za-z]{4}')
ETS.MSE <- llply(ets.fls, function(x) {
    nm <- x %>% 
      str_replace_all('.rds', '') %>% 
      str_split_fixed('\\.', 2) %>% 
      as_data_frame
    names(nm) <- c('Model', 'Type')
    
    y <- paste0('data/', x) %>% 
      read_rds
    
    data.frame(nm, y) %>% as_tibble
  }) %>% bind_rows %>% 
  dplyr::select(Date, Model,Type, Point.Forecast, forClose, 
                USDJPY.Open, USDJPY.High, USDJPY.Low, USDJPY.Close)

ETS.MSE %<>% mutate(
    MSE.1 = case_when(
        substr(Type, 1, 2) == 'Op' ~ mean((Point.Forecast - USDJPY.Open)^2, 
                                          na.rm = TRUE), 
        substr(Type, 1, 2) == 'Hi' ~ mean((Point.Forecast - USDJPY.High)^2, 
                                          na.rm = TRUE), 
        substr(Type, 1, 2) == 'Mn' ~ mean((Point.Forecast - (USDJPY.High + USDJPY.Low)/2)^2, na.rm = TRUE), 
        substr(Type, 1, 2) == 'Lo' ~ mean((Point.Forecast - USDJPY.Low)^2, 
                                          na.rm = TRUE), 
        substr(Type, 1, 2) == 'Cl' ~ mean((Point.Forecast - USDJPY.Close)^2, 
                                          na.rm = TRUE)), 
    MSE.2 = case_when(
        substr(Type, 3, 4) == 'Op' ~ mean((Point.Forecast - USDJPY.Open)^2, 
                                          na.rm = TRUE), 
        substr(Type, 3, 4) == 'Hi' ~ mean((Point.Forecast - USDJPY.High)^2, 
                                          na.rm = TRUE), 
        substr(Type, 3, 4) == 'Mn' ~ mean((Point.Forecast - (USDJPY.High + USDJPY.Low)/2)^2, na.rm = TRUE), 
        substr(Type, 3, 4) == 'Lo' ~ mean((Point.Forecast - USDJPY.Low)^2, 
                                          na.rm = TRUE), 
        substr(Type, 3, 4) == 'Cl' ~ mean((Point.Forecast - USDJPY.Close)^2, 
                                          na.rm = TRUE)))

ETS.MSE %<>% 
    ddply(.(Model, Type), summarise, 
          MSE.1 = mean(MSE.1, na.rm=TRUE), 
          MSE.2 = mean(MSE.2, na.rm=TRUE))

tb14 <- ETS.MSE %>% mutate(
    MSE.1 = ifelse(
      rank(MSE.1) <= 3, 
      cell_spec(
        paste0(round(MSE.1, 7), ' (rank: ', sprintf('%1.f', rank(MSE.1)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.1, 7), ' (rank: ', sprintf('%1.f', rank(MSE.1)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    MSE.2 = ifelse(
      rank(MSE.2) <= 3, 
      cell_spec(
        paste0(round(MSE.2, 7), ' (rank: ', sprintf('%1.f', rank(MSE.2)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(MSE.2, 7), ' (rank: ', sprintf('%1.f', rank(MSE.2)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'MSE of daily Opened and Closed Transaction Orders', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kableExtra::group_rows('AAN', 1, 25, label_row_css = 'background-color: #e68a00; color: #fff;') %>%
  kableExtra::group_rows('AAZ', 26, 50, label_row_css = 'background-color: #ff0000; color: #fff;') %>%
  kableExtra::group_rows('ANN', 51, 75, label_row_css = 'background-color: #bf80ff; color: #fff;') %>%
  kableExtra::group_rows('ANZ', 76, 100, label_row_css = 'background-color: #66ff33; color: #fff;') %>%
  kableExtra::group_rows('AZN', 101, 125, label_row_css = 'background-color: #6666ff; color: #fff;') %>%
  kableExtra::group_rows('AZZ', 126, 150, label_row_css = 'background-color: #66e0ff; color: #fff;') %>%
  kableExtra::group_rows('MAN', 151, 175, label_row_css = 'background-color:#0066ff; color: #fff;') %>%
  kableExtra::group_rows('MAZ', 176, 200, label_row_css = 'background-color: #ff9900; color: #fff;') %>%
  kableExtra::group_rows('MMN', 201, 225, label_row_css = 'background-color: #33ff33; color: #fff;') %>%
  kableExtra::group_rows('MMZ', 226, 250, label_row_css = 'background-color: #339966; color: #fff;') %>%
  kableExtra::group_rows('MNN', 251, 275, label_row_css = 'background-color: #5900b3; color: #fff;') %>%
  kableExtra::group_rows('MNZ', 276, 300, label_row_css = 'background-color: #269900; color: #fff;') %>%
  kableExtra::group_rows('MZN', 301, 325, label_row_css = 'background-color: #808000; color: #fff;') %>%
  kableExtra::group_rows('MZZ', 326, 350, label_row_css = 'background-color: #3399ff; color: #fff;') %>%
  kableExtra::group_rows('ZAN', 351, 375, label_row_css = 'background-color: #003380; color: #fff;') %>%
  kableExtra::group_rows('ZAZ', 376, 400, label_row_css = 'background-color: #804d00; color: #fff;') %>%
  kableExtra::group_rows('ZMN', 401, 425, label_row_css = 'background-color: #d279d2; color: #fff;') %>%
  kableExtra::group_rows('ZMZ', 426, 450, label_row_css = 'background-color: #666; color: #fff;') %>%
  kableExtra::group_rows('ZNN', 451, 475, label_row_css = 'background-color: #ff3377; color: #fff;') %>%
  kableExtra::group_rows('ZNZ', 476, 500, label_row_css = 'background-color: #993399; color: #fff;') %>%
  kableExtra::group_rows('ZZN', 501, 525, label_row_css = 'background-color: #00a3cc; color: #fff;') %>%
  kableExtra::group_rows('ZZZ', 526, 550, label_row_css = 'background-color: #e60000; color: #fff;') %>%
  scroll_box(width = '100%', height = '400px')

tb14
MSE of daily Opened and Closed Transaction Orders
Model Type MSE.1 MSE.2
AAN
AAN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
AAN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
AAN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
AAN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
AAN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
AAN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
AAN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
AAN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
AAN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
AAN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
AAN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
AAN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
AAN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
AAN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
AAN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
AAN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
AAN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
AAN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
AAN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
AAN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
AAN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
AAN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
AAN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
AAN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
AAN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
AAZ
AAZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
AAZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
AAZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
AAZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
AAZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
AAZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
AAZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
AAZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
AAZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
AAZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
AAZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
AAZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
AAZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
AAZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
AAZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
AAZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
AAZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
AAZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
AAZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
AAZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
AAZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
AAZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
AAZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
AAZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
AAZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ANN
ANN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ANN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ANN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ANN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ANN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ANN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ANN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ANN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ANN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ANN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ANN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ANN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ANN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ANN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ANN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ANN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ANN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ANN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ANN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ANN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ANN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ANN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ANN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ANN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ANN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ANZ
ANZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ANZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ANZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ANZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ANZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ANZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ANZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ANZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ANZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ANZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ANZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ANZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ANZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ANZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ANZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ANZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ANZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ANZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ANZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ANZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ANZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ANZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ANZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ANZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ANZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
AZN
AZN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
AZN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
AZN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
AZN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
AZN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
AZN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
AZN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
AZN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
AZN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
AZN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
AZN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
AZN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
AZN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
AZN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
AZN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
AZN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
AZN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
AZN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
AZN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
AZN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
AZN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
AZN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
AZN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
AZN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
AZN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
AZZ
AZZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
AZZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
AZZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
AZZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
AZZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
AZZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
AZZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
AZZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
AZZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
AZZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
AZZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
AZZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
AZZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
AZZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
AZZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
AZZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
AZZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
AZZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
AZZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
AZZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
AZZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
AZZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
AZZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
AZZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
AZZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MAN
MAN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MAN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MAN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MAN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MAN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MAN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MAN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MAN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MAN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MAN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MAN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MAN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MAN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MAN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MAN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MAN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MAN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MAN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MAN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MAN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MAN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MAN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MAN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MAN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MAN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MAZ
MAZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MAZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MAZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MAZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MAZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MAZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MAZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MAZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MAZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MAZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MAZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MAZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MAZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MAZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MAZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MAZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MAZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MAZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MAZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MAZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MAZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MAZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MAZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MAZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MAZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MMN
MMN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MMN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MMN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MMN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MMN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MMN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MMN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MMN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MMN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MMN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MMN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MMN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MMN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MMN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MMN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MMN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MMN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MMN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MMN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MMN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MMN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MMN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MMN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MMN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MMN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MMZ
MMZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MMZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MMZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MMZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MMZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MMZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MMZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MMZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MMZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MMZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MMZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MMZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MMZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MMZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MMZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MMZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MMZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MMZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MMZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MMZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MMZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MMZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MMZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MMZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MMZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MNN
MNN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MNN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MNN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MNN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MNN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MNN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MNN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MNN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MNN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MNN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MNN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MNN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MNN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MNN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MNN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MNN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MNN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MNN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MNN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MNN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MNN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MNN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MNN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MNN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MNN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MNZ
MNZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MNZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MNZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MNZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MNZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MNZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MNZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MNZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MNZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MNZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MNZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MNZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MNZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MNZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MNZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MNZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MNZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MNZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MNZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MNZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MNZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MNZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MNZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MNZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MNZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MZN
MZN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MZN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MZN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MZN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MZN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MZN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MZN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MZN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MZN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MZN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MZN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MZN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MZN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MZN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MZN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MZN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MZN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MZN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MZN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MZN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MZN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MZN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MZN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MZN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MZN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
MZZ
MZZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
MZZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
MZZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
MZZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
MZZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
MZZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
MZZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
MZZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
MZZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
MZZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
MZZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
MZZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
MZZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
MZZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
MZZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
MZZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
MZZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
MZZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
MZZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
MZZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
MZZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
MZZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
MZZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
MZZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
MZZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZAN
ZAN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZAN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZAN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZAN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZAN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZAN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZAN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZAN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZAN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZAN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZAN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZAN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZAN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZAN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZAN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZAN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZAN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZAN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZAN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZAN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZAN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZAN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZAN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZAN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZAN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZAZ
ZAZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZAZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZAZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZAZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZAZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZAZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZAZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZAZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZAZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZAZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZAZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZAZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZAZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZAZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZAZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZAZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZAZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZAZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZAZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZAZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZAZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZAZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZAZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZAZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZAZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZMN
ZMN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZMN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZMN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZMN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZMN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZMN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZMN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZMN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZMN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZMN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZMN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZMN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZMN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZMN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZMN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZMN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZMN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZMN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZMN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZMN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZMN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZMN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZMN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZMN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZMN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZMZ
ZMZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZMZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZMZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZMZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZMZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZMZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZMZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZMZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZMZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZMZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZMZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZMZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZMZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZMZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZMZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZMZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZMZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZMZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZMZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZMZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZMZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZMZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZMZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZMZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZMZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZNN
ZNN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZNN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZNN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZNN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZNN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZNN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZNN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZNN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZNN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZNN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZNN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZNN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZNN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZNN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZNN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZNN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZNN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZNN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZNN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZNN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZNN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZNN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZNN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZNN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZNN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZNZ
ZNZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZNZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZNZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZNZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZNZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZNZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZNZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZNZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZNZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZNZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZNZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZNZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZNZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZNZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZNZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZNZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZNZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZNZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZNZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZNZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZNZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZNZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZNZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZNZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZNZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZZN
ZZN ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZZN ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZZN ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZZN ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZZN ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZZN HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZZN HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZZN HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZZN HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZZN HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZZN LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZZN LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZZN LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZZN LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZZN LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZZN MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZZN MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZZN MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZZN MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZZN MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZZN OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZZN OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZZN OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZZN OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZZN OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)
ZZZ
ZZZ ClCl 0.467076 (rank: 166) 0.467076 (rank: 166)
ZZZ ClHi 0.467076 (rank: 166) 0.8097381 (rank: 386)
ZZZ ClLo 0.467076 (rank: 166) 1.0410108 (rank: 496)
ZZZ ClMn 0.467076 (rank: 166) 0.6447018 (rank: 276)
ZZZ ClOp 0.467076 (rank: 166) 0.4635132 (rank: 56)
ZZZ HiCl 0.8097381 (rank: 386) 0.467076 (rank: 166)
ZZZ HiHi 0.8097381 (rank: 386) 0.8097381 (rank: 386)
ZZZ HiLo 0.8097381 (rank: 386) 1.0410108 (rank: 496)
ZZZ HiMn 0.8097381 (rank: 386) 0.6447018 (rank: 276)
ZZZ HiOp 0.8097381 (rank: 386) 0.4635132 (rank: 56)
ZZZ LoCl 1.0410108 (rank: 496) 0.467076 (rank: 166)
ZZZ LoHi 1.0410108 (rank: 496) 0.8097381 (rank: 386)
ZZZ LoLo 1.0410108 (rank: 496) 1.0410108 (rank: 496)
ZZZ LoMn 1.0410108 (rank: 496) 0.6447018 (rank: 276)
ZZZ LoOp 1.0410108 (rank: 496) 0.4635132 (rank: 56)
ZZZ MnCl 0.6447018 (rank: 276) 0.467076 (rank: 166)
ZZZ MnHi 0.6447018 (rank: 276) 0.8097381 (rank: 386)
ZZZ MnLo 0.6447018 (rank: 276) 1.0410108 (rank: 496)
ZZZ MnMn 0.6447018 (rank: 276) 0.6447018 (rank: 276)
ZZZ MnOp 0.6447018 (rank: 276) 0.4635132 (rank: 56)
ZZZ OpCl 0.4635132 (rank: 56) 0.467076 (rank: 166)
ZZZ OpHi 0.4635132 (rank: 56) 0.8097381 (rank: 386)
ZZZ OpLo 0.4635132 (rank: 56) 1.0410108 (rank: 496)
ZZZ OpMn 0.4635132 (rank: 56) 0.6447018 (rank: 276)
ZZZ OpOp 0.4635132 (rank: 56) 0.4635132 (rank: 56)

Source : Binary.com Interview Q1 (Extention)

From above MSE comparison with intraday-dataset, we know that the intraday data will be more accurate than just daily dataset.

5.2.2 Interday auto.arima Model

ar.fls <- list.files('data', pattern = '^fundAutoArima')
ARIMA.MSE <- llply(ar.fls, function(x) {
    nm <- x %>% 
      str_replace_all('.rds', '') %>% 
      substring(nchar(.) - 3)
    
    y <- paste0('data/', x) %>% 
      read_rds
    
    data.frame(Model = 'auto.arima', Type = nm, y) %>% as_tibble
  }) %>% bind_rows %>% 
  mutate(index = Date) %>% 
  dplyr::select(index, Model, Type, Point.Forecast, forClose, 
                USDJPY.Open, USDJPY.High, USDJPY.Low, USDJPY.Close, 
                -Date)

ARIMA.MSE %<>% mutate(
  MSE.1 = case_when(
    substr(Type, 1, 2) == 'OP' ~ mean((Point.Forecast - USDJPY.Open)^2), 
    substr(Type, 1, 2) == 'HI' ~ mean((Point.Forecast - USDJPY.High)^2), 
    substr(Type, 1, 2) == 'MN' ~ mean((Point.Forecast - (USDJPY.High + USDJPY.Low)/2)^2), 
    substr(Type, 1, 2) == 'LO' ~ mean((Point.Forecast - USDJPY.Low)^2), 
    substr(Type, 1, 2) == 'CL' ~ mean((Point.Forecast - USDJPY.Close)^2)), 
  MSE.2 = case_when(
    substr(Type, 3, 4) == 'OP' ~ mean((Point.Forecast - USDJPY.Open)^2), 
    substr(Type, 3, 4) == 'HI' ~ mean((Point.Forecast - USDJPY.High)^2), 
    substr(Type, 3, 4) == 'MN' ~ mean((Point.Forecast - (USDJPY.High + USDJPY.Low)/2)^2), 
    substr(Type, 3, 4) == 'LO' ~ mean((Point.Forecast - USDJPY.Low)^2), 
    substr(Type, 3, 4) == 'CL' ~ mean((Point.Forecast - USDJPY.Close)^2)))

tb15 <- ARIMA.MSE %>% 
    ddply(.(Model), summarise, 
          MSE.1 = mean(MSE.1, na.rm=TRUE), 
          MSE.2 = mean(MSE.2, na.rm=TRUE)) %>% 
  arrange(MSE.1, MSE.2) %>% 
  kable(caption = 'MSE of daily Opened and Closed Transaction Orders') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))

tb15
MSE of daily Opened and Closed Transaction Orders
Model MSE.1 MSE.2
auto.arima 0.6962568 0.7515629

6 Conclusion

6.1 Summary

From the backtest, we concludes that high-frequency-trading 1 min per unit (ETS:0.46 and auto.arima:0.69) more accurate than interday-trading 1 day per unit.

High- and Low-Frequency Correlations in European Government Bond Spreads and Their Macroeconomic Drivers introduce… suggest… DCC-MIDAS etc. Due to heavily .

By refer to section [#713_Unexpected_Error], here I omitted the data from year 2018-01-01 to 2018-07-09 but the outcome is same. Here I forced to omit the mentioned dataset.

6.2 Dataset Filtering

6.2.1 Overall Dataset from 2015-01-05 to 2017-12-31

if(!exists('seasonal_m1')) {
  seasonal_m1 <- read_rds('data/fx/USDJPY/seasonal_m1.rds')}
ftl1 <- seasonal_m1 %>% 
  filter(index <= as_date('2017-12-31'))
ftl1 %<>% data.table()

m.op <- ftl1[, {
    open = open
    open.Point.Forecast = open.Point.Forecast
    .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
            open.smape = SMAPE(open, open.Point.Forecast), 
            open.mse = MSE(open, open.Point.Forecast), 
            open.rmse = RMSE(open, open.Point.Forecast)), 
        by=.(Model, Period)]}][order(Model, Period), ]

m.hi <- ftl1[, {
    high = high
    high.Point.Forecast = high.Point.Forecast
    .SD[, .(.N, high.mape = MAPE(high, high.Point.Forecast), 
            high.smape = SMAPE(high, high.Point.Forecast), 
            high.mse = MSE(high, high.Point.Forecast), 
            high.rmse = RMSE(high, high.Point.Forecast)), 
        by=.(Model, Period)]}][order(Model, Period), ]

m.lo <- ftl1[, {
    low = low
    low.Point.Forecast = low.Point.Forecast
    .SD[, .(.N, low.mape = MAPE(low, low.Point.Forecast), 
            low.smape = SMAPE(low, low.Point.Forecast), 
            low.mse = MSE(low, low.Point.Forecast), 
            low.rmse = RMSE(low, low.Point.Forecast)), 
        by=.(Model, Period)]}][order(Model, Period), ]

m.cl <- ftl1[, {
    close = close
    close.Point.Forecast = close.Point.Forecast
    .SD[, .(.N, close.mape = MAPE(close, close.Point.Forecast), 
            close.smape = SMAPE(close, close.Point.Forecast), 
            close.mse = MSE(close, close.Point.Forecast), 
            close.rmse = RMSE(close, close.Point.Forecast)), 
        by=.(Model, Period)]}][order(Model, Period), ]

ftl_dat1 <- join_all(list(m.op, m.hi, m.lo, m.cl)) %>% tibble
tb16 <- ftl_dat1 %>% 
  mutate(
    open.mape = ifelse(
      rank(open.mape) <= 3, 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.smape = ifelse(
      rank(open.smape) <= 3, 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.mse = ifelse(
      rank(open.mse) <= 3, 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.rmse = ifelse(
      rank(open.rmse) <= 3, 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    high.mape = ifelse(
      rank(high.mape) <= 3, 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.smape = ifelse(
      rank(high.smape) <= 3, 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.mse = ifelse(
      rank(high.mse) <= 3, 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.rmse = ifelse(
      rank(high.rmse) <= 3, 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    low.mape = ifelse(
      rank(low.mape) <= 3, 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.smape = ifelse(
      rank(low.smape) <= 3, 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.mse = ifelse(
      rank(low.mse) <= 3, 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.rmse = ifelse(
      rank(low.rmse) <= 3, 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    close.mape = ifelse(
      rank(close.mape) <= 3, 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.smape = ifelse(
      rank(close.smape) <= 3, 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.mse = ifelse(
      rank(close.mse) <= 3, 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.rmse = ifelse(
      rank(close.rmse) <= 3, 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min summarised to 1 day per unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  column_spec(3, background = 'LightSlateGrey') %>% 
  column_spec(4, background = 'LightGray') %>% 
  column_spec(5, background = 'Gainsboro') %>% 
  column_spec(6, background = 'LightGray') %>%   
  column_spec(7, background = 'Gainsboro') %>% 
  column_spec(8, background = 'LightGray') %>% 
  column_spec(9, background = 'Gainsboro') %>% 
  column_spec(10, background = 'LightGray') %>%   
  column_spec(11, background = 'Gainsboro') %>% 
  column_spec(12, background = 'LightGray') %>% 
  column_spec(13, background = 'Gainsboro') %>% 
  column_spec(14, background = 'LightGray') %>%   
  column_spec(15, background = 'Gainsboro') %>% 
  column_spec(16, background = 'LightGray') %>% 
  column_spec(17, background = 'Gainsboro') %>% 
  column_spec(18, background = 'LightGray') %>%   
  column_spec(19, background = 'Gainsboro') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb16
Comparison of Models (1 min summarised to 1 day per unit)
Model Period N open.mape open.smape open.mse open.rmse high.mape high.smape high.mse high.rmse low.mape low.smape low.mse low.rmse close.mape close.smape close.mse close.rmse
tbats dy.qt 1107360 0.0028697 (rank: 2) 0.0028715 (rank: 2) 0.2472555 (rank: 2) 0.4972479 (rank: 2) 0.0028737 (rank: 2) 0.0028755 (rank: 2) 0.2475336 (rank: 2) 0.4975274 (rank: 2) 0.0028783 (rank: 2) 0.0028801 (rank: 2) 0.2467347 (rank: 2) 0.4967239 (rank: 2) 0.0028641 (rank: 3) 0.0028659 (rank: 3) 0.2446939 (rank: 2) 0.4946655 (rank: 2)
tbats dy.wk 1107360 0.0028955 (rank: 3) 0.0028974 (rank: 3) 0.2522675 (rank: 3) 0.5022624 (rank: 3) 0.0028838 (rank: 3) 0.0028858 (rank: 3) 0.250246 (rank: 3) 0.500246 (rank: 3) 0.0028883 (rank: 3) 0.0028901 (rank: 3) 0.2534677 (rank: 4) 0.5034558 (rank: 4) 0.0029303 (rank: 4) 0.0029325 (rank: 4) 0.2632625 (rank: 7) 0.5130911 (rank: 7)
tbats dy.wk.mo 1095840 0.0029009 (rank: 4) 0.0029033 (rank: 4) 0.2612362 (rank: 7) 0.5111127 (rank: 7) 0.0028944 (rank: 4) 0.002896 (rank: 4) 0.2547063 (rank: 4) 0.5046843 (rank: 4) 0.0029111 (rank: 4) 0.0029129 (rank: 4) 0.2524913 (rank: 3) 0.5024851 (rank: 3) 0.0028632 (rank: 2) 0.002865 (rank: 2) 0.2471047 (rank: 3) 0.4970963 (rank: 3)
tbats dy.yr 1107360 0.0028639 (rank: 1) 0.0028657 (rank: 1) 0.2463068 (rank: 1) 0.496293 (rank: 1) 0.0028654 (rank: 1) 0.0028672 (rank: 1) 0.2467196 (rank: 1) 0.4967088 (rank: 1) 0.0028677 (rank: 1) 0.0028693 (rank: 1) 0.243529 (rank: 1) 0.4934866 (rank: 1) 0.0028541 (rank: 1) 0.0028559 (rank: 1) 0.243923 (rank: 1) 0.4938856 (rank: 1)
ts mo.1440 1107360 0.0029713 (rank: 7) 0.0029726 (rank: 7) 0.2600749 (rank: 6) 0.5099754 (rank: 6) 0.0029619 (rank: 8) 0.0029634 (rank: 8) 0.2584294 (rank: 7) 0.5083595 (rank: 7) 0.0029577 (rank: 6) 0.0029591 (rank: 6) 0.2556744 (rank: 7) 0.5056425 (rank: 7) 0.002972 (rank: 7) 0.0029733 (rank: 7) 0.2590251 (rank: 6) 0.5089451 (rank: 6)
ts mo.7200 244800 0.0034764 (rank: 10) 0.0034756 (rank: 10) 0.3134664 (rank: 10) 0.5598807 (rank: 10) 0.0035018 (rank: 10) 0.0035011 (rank: 10) 0.3146787 (rank: 10) 0.5609623 (rank: 10) 0.0034669 (rank: 10) 0.0034659 (rank: 10) 0.3119626 (rank: 9) 0.5585361 (rank: 9) 0.0034906 (rank: 10) 0.0034897 (rank: 10) 0.3142609 (rank: 9) 0.5605898 (rank: 9)
ts qt.1440 1107360 0.0029539 (rank: 5) 0.0029554 (rank: 5) 0.2565877 (rank: 4) 0.5065449 (rank: 4) 0.0029549 (rank: 6) 0.0029564 (rank: 6) 0.2568182 (rank: 6) 0.5067723 (rank: 6) 0.0029573 (rank: 5) 0.0029587 (rank: 5) 0.2554396 (rank: 5) 0.5054103 (rank: 5) 0.0029541 (rank: 5) 0.0029556 (rank: 5) 0.2554277 (rank: 4) 0.5053986 (rank: 4)
ts qt.7200 223200 0.0034844 (rank: 11) 0.0034841 (rank: 11) 0.3156878 (rank: 11) 0.561861 (rank: 11) 0.0035078 (rank: 11) 0.0035075 (rank: 11) 0.3167276 (rank: 11) 0.5627856 (rank: 11) 0.0034754 (rank: 11) 0.003475 (rank: 11) 0.3144045 (rank: 10) 0.5607179 (rank: 10) 0.0034988 (rank: 11) 0.0034984 (rank: 11) 0.3168899 (rank: 10) 0.5629298 (rank: 10)
ts wk.1440 1107360 0.003094 (rank: 9) 0.0030953 (rank: 9) 0.275519 (rank: 8) 0.524899 (rank: 8) 0.0030763 (rank: 9) 0.0030778 (rank: 9) 0.2697875 (rank: 9) 0.5194107 (rank: 9) 0.0030852 (rank: 9) 0.0030864 (rank: 9) 0.271656 (rank: 8) 0.5212063 (rank: 8) 0.0030826 (rank: 9) 0.0030839 (rank: 9) 0.2714963 (rank: 8) 0.5210531 (rank: 8)
ts wk.7200 5536800 0.0029907 (rank: 8) 0.0029907 (rank: 8) 0.3108382 (rank: 9) 0.5575287 (rank: 9) 0.0029087 (rank: 5) 0.0029104 (rank: 5) 0.2606856 (rank: 8) 0.5105738 (rank: 8) 0.0030497 (rank: 8) 0.003049 (rank: 8) 0.3365699 (rank: 12) 0.5801465 (rank: 12) 0.0030335 (rank: 8) 0.0030308 (rank: 8) 0.3546758 (rank: 12) 0.5955467 (rank: 12)
ts yr.1440 1107360 0.002954 (rank: 6) 0.0029555 (rank: 6) 0.2566071 (rank: 5) 0.506564 (rank: 5) 0.002955 (rank: 7) 0.0029565 (rank: 7) 0.2567897 (rank: 5) 0.5067442 (rank: 5) 0.0029581 (rank: 7) 0.0029595 (rank: 7) 0.2555165 (rank: 6) 0.5054864 (rank: 6) 0.0029543 (rank: 6) 0.0029557 (rank: 6) 0.255448 (rank: 5) 0.5054187 (rank: 5)
ts yr.7200 208800 0.0036239 (rank: 12) 0.0036236 (rank: 12) 0.3342637 (rank: 12) 0.5781554 (rank: 12) 0.0036485 (rank: 12) 0.0036482 (rank: 12) 0.3353777 (rank: 12) 0.5791181 (rank: 12) 0.0036111 (rank: 12) 0.0036106 (rank: 12) 0.3327021 (rank: 11) 0.5768033 (rank: 11) 0.0036356 (rank: 12) 0.0036352 (rank: 12) 0.335306 (rank: 11) 0.5790561 (rank: 11)

Above table summarized the total observations with mape, smape, mse and rmse values (which is not nested summarize not daily settlement for P&L).

6.2.2 Daily Dataset from 2015-01-05 to 2017-12-31

open.accr <- ftl1[, {
  open = open
  open.Point.Forecast = open.Point.Forecast
  .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
          open.smape = SMAPE(open, open.Point.Forecast), 
          open.mse = MSE(open, open.Point.Forecast), 
          open.rmse = RMSE(open, open.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

high.accr <- ftl1[, {
  high = high
  high.Point.Forecast = high.Point.Forecast
  .SD[, .(.N, high.mape = MAPE(high, high.Point.Forecast), 
          high.smape = SMAPE(high, high.Point.Forecast), 
          high.mse = MSE(high, high.Point.Forecast), 
          high.rmse = RMSE(high, high.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

low.accr <- ftl1[, {
  low = low
  low.Point.Forecast = low.Point.Forecast
  .SD[, .(.N, low.mape = MAPE(low, low.Point.Forecast), 
          low.smape = SMAPE(low, low.Point.Forecast), 
          low.mse = MSE(low, low.Point.Forecast), 
          low.rmse = RMSE(low, low.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

close.accr <- ftl1[, {
  close = close
  close.Point.Forecast = close.Point.Forecast
  .SD[, .(.N, close.mape = MAPE(close, close.Point.Forecast), 
          close.smape = SMAPE(close, close.Point.Forecast), 
          close.mse = MSE(close, close.Point.Forecast), 
          close.rmse = RMSE(close, close.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

open.sm <- open.accr[, list(open.mape = mean(open.mape), 
                            open.smape = mean(open.smape), 
                            open.mse = mean(open.mse), 
                            open.rmse = mean(open.rmse)), 
                       by=.(Model, Period)]

high.sm <- high.accr[, list(high.mape = mean(high.mape), 
                            high.smape = mean(high.smape), 
                            high.mse = mean(high.mse), 
                            high.rmse = mean(high.rmse)), 
                       by=.(Model, Period)]

low.sm <- low.accr[, list(low.mape = mean(low.mape), 
                          low.smape = mean(low.smape), 
                          low.mse = mean(low.mse), 
                          low.rmse = mean(low.rmse)), 
                       by=.(Model, Period)]

close.sm <- close.accr[, list(close.mape = mean(close.mape), 
                              close.smape = mean(close.smape), 
                              close.mse = mean(close.mse), 
                              close.rmse = mean(close.rmse)), 
                       by=.(Model, Period)]

ftl_dat2 <- join_all(list(open.sm, high.sm, low.sm, close.sm)) %>% 
  tibble
tb17 <- ftl_dat2 %>% 
  mutate(
    open.mape = ifelse(
      rank(open.mape) <= 3, 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mape, 7), ' (rank: ', sprintf('%1.f', rank(open.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.smape = ifelse(
      rank(open.smape) <= 3, 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.smape, 7), ' (rank: ', sprintf('%1.f', rank(open.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.mse = ifelse(
      rank(open.mse) <= 3, 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.mse, 7), ' (rank: ', sprintf('%1.f', rank(open.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    open.rmse = ifelse(
      rank(open.rmse) <= 3, 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(open.rmse, 7), ' (rank: ', sprintf('%1.f', rank(open.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    high.mape = ifelse(
      rank(high.mape) <= 3, 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mape, 7), ' (rank: ', sprintf('%1.f', rank(high.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.smape = ifelse(
      rank(high.smape) <= 3, 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.smape, 7), ' (rank: ', sprintf('%1.f', rank(high.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.mse = ifelse(
      rank(high.mse) <= 3, 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.mse, 7), ' (rank: ', sprintf('%1.f', rank(high.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    high.rmse = ifelse(
      rank(high.rmse) <= 3, 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(high.rmse, 7), ' (rank: ', sprintf('%1.f', rank(high.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    low.mape = ifelse(
      rank(low.mape) <= 3, 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mape, 7), ' (rank: ', sprintf('%1.f', rank(low.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.smape = ifelse(
      rank(low.smape) <= 3, 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.smape, 7), ' (rank: ', sprintf('%1.f', rank(low.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.mse = ifelse(
      rank(low.mse) <= 3, 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.mse, 7), ' (rank: ', sprintf('%1.f', rank(low.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    low.rmse = ifelse(
      rank(low.rmse) <= 3, 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(low.rmse, 7), ' (rank: ', sprintf('%1.f', rank(low.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    
    close.mape = ifelse(
      rank(close.mape) <= 3, 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mape, 7), ' (rank: ', sprintf('%1.f', rank(close.mape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.smape = ifelse(
      rank(close.smape) <= 3, 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.smape, 7), ' (rank: ', sprintf('%1.f', rank(close.smape)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.mse = ifelse(
      rank(close.mse) <= 3, 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.mse, 7), ' (rank: ', sprintf('%1.f', rank(close.mse)), ')'), 
        'html', color = 'grey', italic = TRUE)), 
    close.rmse = ifelse(
      rank(close.rmse) <= 3, 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'darkgoldenrod', bold = TRUE), 
      cell_spec(
        paste0(round(close.rmse, 7), ' (rank: ', sprintf('%1.f', rank(close.rmse)), ')'), 
        'html', color = 'grey', italic = TRUE))) %>% 
  kbl('html', caption = 'Comparison of Models (1 min summarised to 1 day per unit)', escape = FALSE) %>% 
  ## https://www.w3schools.com/cssref/css_colors.asp
  row_spec(0, background = 'DimGrey') %>% 
  column_spec(1, background = 'CornflowerBlue') %>% 
  column_spec(2, background = 'DarkGrey') %>% 
  #column_spec(3, background = 'LightSlateGrey') %>% 
  column_spec(3, background = 'LightGray') %>% 
  column_spec(4, background = 'Gainsboro') %>% 
  column_spec(5, background = 'LightGray') %>%   
  column_spec(6, background = 'Gainsboro') %>% 
  column_spec(7, background = 'LightGray') %>% 
  column_spec(8, background = 'Gainsboro') %>% 
  column_spec(9, background = 'LightGray') %>%   
  column_spec(10, background = 'Gainsboro') %>% 
  column_spec(11, background = 'LightGray') %>% 
  column_spec(12, background = 'Gainsboro') %>% 
  column_spec(13, background = 'LightGray') %>%   
  column_spec(14, background = 'Gainsboro') %>% 
  column_spec(15, background = 'LightGray') %>% 
  column_spec(16, background = 'Gainsboro') %>% 
  column_spec(17, background = 'LightGray') %>%   
  column_spec(18, background = 'Gainsboro') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  kable_material(full_width = FALSE) %>% ##`full_width = FALSE` will auto adjust every single columns width to fit the table full width.
  scroll_box(width = '100%')#, height = '400px')

tb17
Comparison of Models (1 min summarised to 1 day per unit)
Model Period open.mape open.smape open.mse open.rmse high.mape high.smape high.mse high.rmse low.mape low.smape low.mse low.rmse close.mape close.smape close.mse close.rmse
tbats dy.qt 0.0031798 (rank: 2) 0.0031822 (rank: 2) 0.3086508 (rank: 2) 0.4131941 (rank: 2) 0.0031952 (rank: 2) 0.0031978 (rank: 2) 0.3113727 (rank: 2) 0.4148375 (rank: 2) 0.0031943 (rank: 3) 0.0031963 (rank: 3) 0.3062676 (rank: 2) 0.4146386 (rank: 3) 0.0031765 (rank: 3) 0.0031787 (rank: 3) 0.3051462 (rank: 3) 0.4128326 (rank: 3)
tbats dy.wk 0.0032293 (rank: 4) 0.0032321 (rank: 4) 0.3236162 (rank: 7) 0.4187807 (rank: 4) 0.0032012 (rank: 3) 0.0032039 (rank: 3) 0.3131142 (rank: 3) 0.4153888 (rank: 3) 0.0031922 (rank: 2) 0.0031943 (rank: 2) 0.3104748 (rank: 3) 0.4146143 (rank: 2) 0.0032804 (rank: 7) 0.003283 (rank: 7) 0.3329877 (rank: 8) 0.4252121 (rank: 7)
tbats dy.yr 0.0031794 (rank: 1) 0.0031819 (rank: 1) 0.3079539 (rank: 1) 0.4128712 (rank: 1) 0.0031843 (rank: 1) 0.0031869 (rank: 1) 0.3105311 (rank: 1) 0.4134938 (rank: 1) 0.0031787 (rank: 1) 0.0031806 (rank: 1) 0.3006453 (rank: 1) 0.4128344 (rank: 1) 0.0031654 (rank: 2) 0.0031677 (rank: 2) 0.3036 (rank: 1) 0.4114234 (rank: 2)
ts mo.1440 0.003268 (rank: 7) 0.00327 (rank: 7) 0.3193867 (rank: 6) 0.4240055 (rank: 7) 0.003274 (rank: 8) 0.0032763 (rank: 8) 0.3219065 (rank: 7) 0.4247684 (rank: 8) 0.0032505 (rank: 6) 0.0032523 (rank: 6) 0.3120875 (rank: 6) 0.4219785 (rank: 6) 0.0032666 (rank: 6) 0.0032685 (rank: 6) 0.3167097 (rank: 6) 0.4238872 (rank: 6)
ts mo.7200 0.0041186 (rank: 11) 0.0041147 (rank: 11) 0.425753 (rank: 11) 0.5564735 (rank: 11) 0.0041905 (rank: 11) 0.0041868 (rank: 11) 0.4366597 (rank: 11) 0.5650381 (rank: 11) 0.0040769 (rank: 11) 0.0040725 (rank: 11) 0.4221267 (rank: 11) 0.5517966 (rank: 11) 0.0041607 (rank: 11) 0.0041564 (rank: 11) 0.4379246 (rank: 11) 0.5616704 (rank: 11)
ts qt.1440 0.0032537 (rank: 5) 0.0032559 (rank: 5) 0.3165277 (rank: 3) 0.4223453 (rank: 5) 0.0032589 (rank: 6) 0.0032613 (rank: 6) 0.3186365 (rank: 6) 0.4229761 (rank: 6) 0.0032501 (rank: 5) 0.0032518 (rank: 5) 0.3116999 (rank: 4) 0.4219301 (rank: 5) 0.0032516 (rank: 4) 0.0032536 (rank: 4) 0.3136698 (rank: 4) 0.4221424 (rank: 4)
ts qt.7200 0.004058 (rank: 10) 0.0040546 (rank: 10) 0.42255 (rank: 10) 0.5479559 (rank: 10) 0.004129 (rank: 10) 0.0041259 (rank: 10) 0.4333607 (rank: 10) 0.5565739 (rank: 10) 0.0039968 (rank: 10) 0.0039929 (rank: 10) 0.4190357 (rank: 10) 0.5412921 (rank: 10) 0.0040893 (rank: 10) 0.0040855 (rank: 10) 0.4356525 (rank: 10) 0.5524039 (rank: 10)
ts wk.1440 0.0033941 (rank: 9) 0.0033961 (rank: 9) 0.335421 (rank: 8) 0.4388743 (rank: 9) 0.0033706 (rank: 9) 0.0033729 (rank: 9) 0.330303 (rank: 9) 0.4356482 (rank: 9) 0.0033746 (rank: 8) 0.0033762 (rank: 8) 0.3273219 (rank: 8) 0.4362639 (rank: 8) 0.0033759 (rank: 9) 0.0033779 (rank: 9) 0.3303105 (rank: 7) 0.4365981 (rank: 9)
ts wk.7200 0.0033234 (rank: 8) 0.003324 (rank: 8) 0.374078 (rank: 9) 0.4311754 (rank: 8) 0.0032445 (rank: 5) 0.0032467 (rank: 5) 0.32989 (rank: 8) 0.4206439 (rank: 5) 0.0033927 (rank: 9) 0.0033931 (rank: 9) 0.4060808 (rank: 9) 0.4394059 (rank: 9) 0.0033423 (rank: 8) 0.0033406 (rank: 8) 0.4049183 (rank: 9) 0.4323124 (rank: 8)
ts yr.1440 0.0032538 (rank: 6) 0.003256 (rank: 6) 0.3165405 (rank: 4) 0.4223546 (rank: 6) 0.0032591 (rank: 7) 0.0032615 (rank: 7) 0.3185936 (rank: 5) 0.4229942 (rank: 7) 0.0032507 (rank: 7) 0.0032525 (rank: 7) 0.3117464 (rank: 5) 0.4220256 (rank: 7) 0.0032518 (rank: 5) 0.0032538 (rank: 5) 0.3136856 (rank: 5) 0.4221609 (rank: 5)
ts yr.7200 0.0042881 (rank: 12) 0.0042843 (rank: 12) 0.4553046 (rank: 12) 0.5785254 (rank: 12) 0.0043671 (rank: 12) 0.0043636 (rank: 12) 0.467057 (rank: 12) 0.5881937 (rank: 12) 0.0042393 (rank: 12) 0.004235 (rank: 12) 0.4522995 (rank: 12) 0.5732734 (rank: 12) 0.0043391 (rank: 12) 0.0043348 (rank: 12) 0.4701278 (rank: 12) 0.5850767 (rank: 12)
tbats dy.wk.mo 0.003199 (rank: 3) 0.0032018 (rank: 3) 0.3182763 (rank: 5) 0.4154379 (rank: 3) 0.0032051 (rank: 4) 0.0032076 (rank: 4) 0.3162797 (rank: 4) 0.416051 (rank: 4) 0.0032332 (rank: 4) 0.0032355 (rank: 4) 0.31388 (rank: 7) 0.4190098 (rank: 4) 0.0031597 (rank: 1) 0.0031621 (rank: 1) 0.3038012 (rank: 2) 0.4105265 (rank: 1)

Above table summarized the daily mape, smape, mse and rmse values and then summarized again the models (which is nested summarize due to daily settlement for P&L).

sarimax, tbats with xreg I will also compare the fracdiff() models.

7 Appendix

7.1 Blooper

7.1.1 Efficiency

Efficiency

There cost alot of time for couple models comparison.

# Test the efficiency
> dim(data_m1)
[1] 1324800       5
> microbenchmark(data_m1$index[1], tidyquant::FIRST(data_m1$index), tail(data_m1$index, 1), data_m1$index %>% .[1], data_m1$index %>% (tidyquant::FIRST), data_m1$index %>% tail(1))
Unit: microseconds
                                 expr  min    lq    mean median    uq    max neval
                     data_m1$index[1]  8.8 10.40  16.352  11.50 14.20  106.9   100
      tidyquant::FIRST(data_m1$index) 34.4 41.25 140.854  46.30 65.15 7256.6   100
               tail(data_m1$index, 1) 20.3 24.25  39.063  27.80 36.45  180.4   100
               data_m1$index %>% .[1] 12.2 14.60  23.498  15.85 18.70  229.3   100
 data_m1$index %>% (tidyquant::FIRST) 39.7 44.05  67.244  50.25 62.60  694.6   100
            data_m1$index %>% tail(1) 25.0 30.60  64.955  36.40 57.65  613.7   100

# Test the efficiency
> system.time({
+     smp <- data_m1 %>% 
+         tk_xts(silent = TRUE);
+     dt %<>% as_date;
+     smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))];
+     
+     mts <- smp %>% 
+         msts(seasonal.periods = c(1440, nrow(smp)))
+ })
   user  system elapsed 
   0.63    0.09    1.16 
> system.time({
+     smp <- tk_xts(data_m1, silent = TRUE);
+     dt %<>% as_date;
+     smp <- smp[paste0(dt %m-% months(3) + seconds(59), '/', dt + seconds(59))];
+     
+     mts <- msts(smp, seasonal.periods = c(1440, nrow(smp)))
+ })
   user  system elapsed 
   0.16    0.06    0.42

# Test the efficiency
> microbenchmark(
+     as_tibble(matrix(weekdays(unique(na.omit(data.table(data_m1))[weekdays(index) %in% c('Saturday', 'Sunday')]$index)), byrow = TRUE, ncol = 6)), 
+     as_tibble(matrix(weekdays(as_date(data_m1$index))[weekdays(as_date(data_m1$index)) %in% c('Saturday', 'Sunday')], byrow = TRUE, ncol = 6))
+ )
Unit: seconds
                                                                                                                                               expr
 as_tibble(matrix(weekdays(unique(na.omit(data.table(data_m1))[weekdays(index) %in%      c("Saturday", "Sunday")]$index)), byrow = TRUE, ncol = 6))
    as_tibble(matrix(weekdays(as_date(data_m1$index))[weekdays(as_date(data_m1$index)) %in%      c("Saturday", "Sunday")], byrow = TRUE, ncol = 6))
       min        lq      mean    median        uq       max neval
  4.923539  5.102061  5.388813  5.368958  5.552245  6.816211   100
 10.182849 10.652719 11.118986 11.026882 11.546361 13.484108   100
## https://stackoverflow.com/questions/7014387/whats-the-difference-between-1l-and-1
microbenchmark(seq(1L, 100000000L), seq(1, 100000000), seq(1L, 1e+08), seq(1, 1e+08L), seq(1L, 10L^8L), seq(1, 10^8))
## Unit: microseconds
##                 expr min  lq  mean median   uq  max neval
##  seq(1L, 100000000L) 5.3 5.5 7.184   5.90 6.80 39.5   100
##        seq(1, 1e+08) 5.2 5.5 6.646   5.80 6.40 53.1   100
##       seq(1L, 1e+08) 5.1 5.5 6.860   5.80 6.85 37.3   100
##   seq(1, 100000000L) 5.3 5.6 7.072   5.90 6.90 30.3   100
##      seq(1L, 10L^8L) 5.6 6.0 8.567   6.35 7.10 90.1   100
##         seq(1, 10^8) 5.6 5.9 6.992   6.30 7.60 13.7   100

7.1.2 Small Mistake

Small Mistake

Here I noticed that there have transactions in Saturday and Sunday as show below when I continue R&D after 2 years from 2018 How Do Orders Execute Over The Weekend?. It is not a big problem since this paper only compare the models and choose the best fit model for high-frequency-trading.

dt_data_m1 <- na.omit(data.table(data_m1))
rm(data_m1)

## date breakdown
dtb <- as_tibble(matrix(unique(as.character(as_date(dt_data_m1$index))), byrow = TRUE, ncol = 6)) %>% mutate_if(is.character, as_date)
## Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2.0.0.
## Using compatibility `.name_repair`.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
dtb %>% 
  mutate(dif = as.numeric(V1 - lag(V1))) %>% 
  dplyr::filter(dif != 7)
## # A tibble: 4 x 7
##   V1         V2         V3         V4         V5         V6           dif
##   <date>     <date>     <date>     <date>     <date>     <date>     <dbl>
## 1 2016-12-27 2016-12-28 2016-12-29 2016-12-30 2016-12-31 2017-01-01     8
## 2 2017-01-09 2017-01-10 2017-01-11 2017-01-12 2017-01-13 2017-01-14     6
## 3 2017-12-26 2017-12-27 2017-12-28 2017-12-29 2017-12-30 2017-12-31     8
## 4 2018-01-08 2018-01-09 2018-01-10 2018-01-11 2018-01-12 2018-01-13     6
## weekdays breakdown
wkb <- dtb %>% 
    mutate_if(is.Date, weekdays) %>% mutate_if(is.character, as.factor)
wkb #%>% 
## # A tibble: 183 x 6
##    V1     V2      V3        V4       V5     V6      
##    <fct>  <fct>   <fct>     <fct>    <fct>  <fct>   
##  1 Monday Tuesday Wednesday Thursday Friday Saturday
##  2 Monday Tuesday Wednesday Thursday Friday Saturday
##  3 Monday Tuesday Wednesday Thursday Friday Saturday
##  4 Monday Tuesday Wednesday Thursday Friday Saturday
##  5 Monday Tuesday Wednesday Thursday Friday Saturday
##  6 Monday Tuesday Wednesday Thursday Friday Saturday
##  7 Monday Tuesday Wednesday Thursday Friday Saturday
##  8 Monday Tuesday Wednesday Thursday Friday Saturday
##  9 Monday Tuesday Wednesday Thursday Friday Saturday
## 10 Monday Tuesday Wednesday Thursday Friday Saturday
## # ... with 173 more rows
#  dplyr::filter(V1 != 'Monday')

7.1.3 Unexpected Error

7.1.3.0.1 Open Price
## Due to the low precision and low accuracy, here I plot the graph and rerun the code to check the models.
yr_2018 <- data.table(seasonal_m1)[as_date(index) > as_date('2017-12-31')]

dy.qt_dy.yr_2018 <- yr_2018[Model == 'tbats' & Period %in% c('dy.qt', 'dy.yr')]

plt_s1 <- yr_2018[, {
  open = open
  open.Point.Forecast = open.Point.Forecast
  .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
          open.smape = SMAPE(open, open.Point.Forecast), 
          open.mse = MSE(open, open.Point.Forecast), 
          open.rmse = RMSE(open, open.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

plt_s2 <- dy.qt_dy.yr_2018[, {
  open = open
  open.Point.Forecast = open.Point.Forecast
  .SD[, .(.N, open.mape = MAPE(open, open.Point.Forecast), 
          open.smape = SMAPE(open, open.Point.Forecast), 
          open.mse = MSE(open, open.Point.Forecast), 
          open.rmse = RMSE(open, open.Point.Forecast)), 
      by={index=as_date(index)}]}, 
  by=.(Model, Period)]

## ------------------------------------------
##modify dataset
yr_2018 %<>% 
  tidyr::unite(Model, Model:Period) %>% 
  data.table
prc <- unique(yr_2018[, .(index, open, high, low, close)])
prc <- prc[, Model := 'Market.Price'][]
yr_2018 <- yr_2018[, (c('open', 'high', 'low', 'close')) := NULL]
names(yr_2018) <- c('index', 'Model', 'open', 'high', 'low', 'close')
yr_2018 <- rbind(yr_2018, prc)
yr_2018 <- data.table(yr_2018)[order(index)]
rm(prc)

mDT <- yr_2018 %>% pivot_longer(!c(index, Model), names_to = 'Variable', values_to = 'Price')

mDT %<>% 
  tidyr::unite(Model, Model:Variable) %>% 
  data.table

## ------------------------------------------
plt_s1 %>% 
  kbl('html', caption = 'Data Sample', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Data Sample
Model Period index N open.mape open.smape open.mse open.rmse
tbats dy.qt 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.qt 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.qt 2018-01-05 1440 0.0033109 0.0033042 0.1712639 0.4138404
tbats dy.qt 2018-01-06 1 0.0033901 0.0033844 0.1459240 0.3820000
tbats dy.qt 2018-01-08 1439 0.0039391 0.0039311 0.2050751 0.4528522
tbats dy.qt 2018-01-09 1440 0.0012943 0.0012931 0.0419181 0.2047390
tbats dy.qt 2018-01-10 1440 0.0073048 0.0073400 0.8879488 0.9423103
tbats dy.qt 2018-01-11 1440 0.0103775 0.0104334 1.4110712 1.1878852
tbats dy.qt 2018-01-12 1440 0.0130046 0.0130904 2.1649021 1.4713606
tbats dy.qt 2018-01-13 1 0.0147054 0.0148143 2.7456490 1.6570000
tbats dy.qt 2018-01-15 1439 0.0177735 0.0179342 4.0444477 2.0110812
tbats dy.qt 2018-01-16 1440 0.0175204 0.0176763 3.9235329 1.9807910
tbats dy.qt 2018-01-17 1440 0.0173391 0.0174925 3.8604893 1.9648128
tbats dy.qt 2018-01-18 1440 0.0132828 0.0133725 2.2636575 1.5045456
tbats dy.qt 2018-01-19 1440 0.0169647 0.0171110 3.6821392 1.9188901
tbats dy.qt 2018-01-20 1 0.0163738 0.0165090 3.4040250 1.8450000
tbats dy.qt 2018-01-22 1439 0.0164475 0.0165846 3.4523110 1.8580396
tbats dy.qt 2018-01-23 1440 0.0180156 0.0181820 4.1856644 2.0458896
tbats dy.qt 2018-01-24 1440 0.0268881 0.0272614 9.3470521 3.0572949
tbats dy.qt 2018-01-25 1440 0.0322722 0.0328036 13.2754630 3.6435509
tbats dy.qt 2018-01-26 1440 0.0318377 0.0323591 13.0263583 3.6092047
tbats dy.qt 2018-01-27 1 0.0359514 0.0366094 16.4106010 4.0510000
tbats dy.qt 2018-01-29 1439 0.0339983 0.0345871 14.6966838 3.8336254
tbats dy.qt 2018-01-30 1440 0.0346458 0.0352574 15.2604667 3.9064647
tbats dy.qt 2018-01-31 1440 0.0333584 0.0339260 14.1707246 3.7644023
tbats dy.qt 2018-02-01 1440 0.0288410 0.0292640 10.5843271 3.2533563
tbats dy.qt 2018-02-02 1440 0.0249175 0.0252362 7.9895620 2.8265813
tbats dy.qt 2018-02-03 1 0.0222400 0.0224901 6.2800360 2.5060000
tbats dy.qt 2018-02-05 1439 0.0247250 0.0250364 7.8101566 2.7946657
tbats dy.qt 2018-02-06 1440 0.0316136 0.0321241 12.7564999 3.5716243
tbats dy.qt 2018-02-07 1440 0.0298147 0.0302673 11.3204578 3.3645888
tbats dy.qt 2018-02-08 1440 0.0295570 0.0300045 11.1915858 3.3453828
tbats dy.qt 2018-02-09 1440 0.0340752 0.0346683 14.8008132 3.8471825
tbats dy.qt 2018-02-10 1 0.0344693 0.0350738 15.0854560 3.8840000
tbats dy.qt 2018-02-12 1439 0.0355512 0.0361948 16.0525253 4.0065603
tbats dy.qt 2018-02-13 1440 0.0415012 0.0423895 22.0797777 4.6989124
tbats dy.qt 2018-02-14 1440 0.0478455 0.0490216 29.1477209 5.3988629
tbats dy.qt 2018-02-15 1440 0.0548283 0.0563755 38.2107906 6.1814877
tbats dy.qt 2018-02-16 1440 0.0585071 0.0602717 43.4960112 6.5951506
tbats dy.qt 2018-02-17 1 0.0565673 0.0582138 40.6278760 6.3740000
tbats dy.qt 2018-02-19 1439 0.0018810 0.0018789 0.0502889 0.2242519
tbats dy.qt 2018-02-20 1440 0.0039150 0.0039051 0.2257944 0.4751782
tbats dy.qt 2018-02-21 1440 0.0025510 0.0025468 0.0960670 0.3099467
tbats dy.qt 2018-02-22 1440 0.0053739 0.0053927 0.4358929 0.6602219
tbats dy.qt 2018-02-23 1440 0.0010663 0.0010658 0.0193807 0.1392147
tbats dy.qt 2018-02-24 1 0.0012813 0.0012805 0.0187112 0.1367888
tbats dy.qt 2018-02-26 1439 0.0017207 0.0017224 0.0487130 0.2207101
tbats dy.qt 2018-02-27 1440 0.0017627 0.0017597 0.0692587 0.2631706
tbats dy.qt 2018-02-28 1440 0.0028550 0.0028609 0.1383402 0.3719411
tbats dy.qt 2018-03-01 1440 0.0014258 0.0014257 0.0407300 0.2018167
tbats dy.qt 2018-03-02 1440 0.0044554 0.0044691 0.3069946 0.5540710
tbats dy.qt 2018-03-03 1 0.0047471 0.0047584 0.2543040 0.5042856
tbats dy.qt 2018-03-05 1439 0.0020813 0.0020805 0.0656674 0.2562565
tbats dy.qt 2018-03-06 1440 0.0010507 0.0010510 0.0191561 0.1384056
tbats dy.qt 2018-03-07 1440 0.0032845 0.0032912 0.1519726 0.3898366
tbats dy.qt 2018-03-08 1440 0.0006005 0.0006004 0.0064385 0.0802403
tbats dy.qt 2018-03-09 1440 0.0048093 0.0047965 0.2887926 0.5373943
tbats dy.qt 2018-03-10 1 0.0057372 0.0057207 0.3713635 0.6093960
tbats dy.qt 2018-03-12 1439 0.0023390 0.0023423 0.0759089 0.2755157
tbats dy.qt 2018-03-13 1440 0.0028999 0.0028931 0.1572071 0.3964935
tbats dy.qt 2018-03-14 1440 0.0013291 0.0013305 0.0331019 0.1819393
tbats dy.qt 2018-03-15 1440 0.0023845 0.0023882 0.0828577 0.2878502
tbats dy.qt 2018-03-16 1440 0.0033274 0.0033348 0.1665281 0.4080786
tbats dy.qt 2018-03-17 1 0.0034003 0.0034061 0.1307541 0.3615994
tbats dy.qt 2018-03-19 1439 0.0011850 0.0011852 0.0217987 0.1476438
tbats dy.qt 2018-03-20 1440 0.0022856 0.0022823 0.0757474 0.2752225
tbats dy.qt 2018-03-21 1440 0.0017213 0.0017237 0.0554248 0.2354247
tbats dy.qt 2018-03-22 1440 0.0034462 0.0034537 0.1688976 0.4109715
tbats dy.qt 2018-03-23 1440 0.0032304 0.0032366 0.1360697 0.3688763
tbats dy.qt 2018-03-24 1 0.0051877 0.0052012 0.2983075 0.5461754
tbats dy.qt 2018-03-26 1439 0.0028861 0.0028807 0.1198734 0.3462273
tbats dy.qt 2018-03-27 1440 0.0019733 0.0019708 0.0548570 0.2342156
tbats dy.qt 2018-03-28 1440 0.0054888 0.0054627 0.5830772 0.7635949
tbats dy.qt 2018-03-29 1440 0.0026981 0.0027027 0.1069173 0.3269821
tbats dy.qt 2018-03-30 1440 0.0017376 0.0017394 0.0399285 0.1998213
tbats dy.qt 2018-03-31 1 0.0013576 0.0013585 0.0208770 0.1444887
tbats dy.qt 2018-04-02 1439 0.0011295 0.0011310 0.0377658 0.1943343
tbats dy.qt 2018-04-03 1440 0.0027903 0.0027837 0.1511955 0.3888386
tbats dy.qt 2018-04-04 1440 0.0017291 0.0017314 0.0600898 0.2451322
tbats dy.qt 2018-04-05 1440 0.0028588 0.0028526 0.1439445 0.3794002
tbats dy.qt 2018-04-06 1440 0.0017676 0.0017703 0.0636784 0.2523457
tbats dy.qt 2018-04-07 1 0.0041444 0.0041530 0.1980616 0.4450411
tbats dy.qt 2018-04-09 1439 0.0009020 0.0009017 0.0139755 0.1182182
tbats dy.qt 2018-04-10 1440 0.0024381 0.0024343 0.0871189 0.2951591
tbats dy.qt 2018-04-11 1440 0.0020890 0.0020920 0.0689188 0.2625239
tbats dy.qt 2018-04-12 1440 0.0022921 0.0022879 0.0981073 0.3132209
tbats dy.qt 2018-04-13 1440 0.0015270 0.0015252 0.0423808 0.2058660
tbats dy.qt 2018-04-14 1 0.0003289 0.0003289 0.0012460 0.0352982
tbats dy.qt 2018-04-16 1439 0.0012836 0.0012842 0.0236461 0.1537730
tbats dy.qt 2018-04-17 1440 0.0006967 0.0006970 0.0083520 0.0913892
tbats dy.qt 2018-04-18 1440 0.0020366 0.0020342 0.0562271 0.2371224
tbats dy.qt 2018-04-19 1440 0.0012621 0.0012611 0.0218887 0.1479484
tbats dy.qt 2018-04-20 1440 0.0020490 0.0020465 0.0577120 0.2402333
tbats dy.qt 2018-04-21 1 0.0025545 0.0025513 0.0752254 0.2742725
tbats dy.qt 2018-04-23 1439 0.0045611 0.0045455 0.3645420 0.6037731
tbats dy.qt 2018-04-24 1440 0.0011920 0.0011908 0.0309522 0.1759325
tbats dy.qt 2018-04-25 1440 0.0027018 0.0026968 0.1197275 0.3460166
tbats dy.qt 2018-04-26 1440 0.0010282 0.0010289 0.0189114 0.1375186
tbats dy.qt 2018-04-27 1440 0.0008721 0.0008727 0.0162402 0.1274369
tbats dy.qt 2018-04-28 1 0.0022253 0.0022278 0.0591608 0.2432299
tbats dy.qt 2018-04-30 1439 0.0014960 0.0014945 0.0372243 0.1929359
tbats dy.qt 2018-05-01 1440 0.0019179 0.0019150 0.0704245 0.2653761
tbats dy.qt 2018-05-02 1440 0.0006541 0.0006544 0.0081468 0.0902595
tbats dy.qt 2018-05-03 1440 0.0032235 0.0032314 0.1899514 0.4358341
tbats dy.qt 2018-05-04 1440 0.0010354 0.0010363 0.0206722 0.1437784
tbats dy.qt 2018-05-05 1 0.0010681 0.0010687 0.0136020 0.1166277
tbats dy.qt 2018-05-07 1439 0.0010949 0.0010943 0.0214123 0.1463294
tbats dy.qt 2018-05-08 1440 0.0008264 0.0008266 0.0120175 0.1096243
tbats dy.qt 2018-05-09 1440 0.0041053 0.0040954 0.2378058 0.4876534
tbats dy.qt 2018-05-10 1440 0.0013572 0.0013584 0.0376933 0.1941477
tbats dy.qt 2018-05-11 1440 0.0007071 0.0007073 0.0085429 0.0924277
tbats dy.qt 2018-05-12 1 0.0001085 0.0001085 0.0001408 0.0118658
tbats dy.qt 2018-05-14 1439 0.0011015 0.0011008 0.0199788 0.1413464
tbats dy.qt 2018-05-15 1440 0.0030341 0.0030269 0.1740472 0.4171897
tbats dy.qt 2018-05-16 1440 0.0010763 0.0010771 0.0198791 0.1409933
tbats dy.qt 2018-05-17 1440 0.0020281 0.0020259 0.0650995 0.2551460
tbats dy.qt 2018-05-18 1440 0.0011063 0.0011057 0.0197986 0.1407074
tbats dy.qt 2018-05-19 1 0.0001151 0.0001151 0.0001625 0.0127482
tbats dy.qt 2018-05-21 1439 0.0034661 0.0034591 0.1709283 0.4134347
tbats dy.qt 2018-05-22 1440 0.0008708 0.0008712 0.0117005 0.1081689
tbats dy.qt 2018-05-23 1440 0.0057107 0.0057324 0.5328135 0.7299408
tbats dy.qt 2018-05-24 1440 0.0049709 0.0049858 0.3584635 0.5987182
tbats dy.qt 2018-05-25 1440 0.0016291 0.0016273 0.0430735 0.2075415
tbats dy.qt 2018-05-26 1 0.0012189 0.0012181 0.0177330 0.1331653
tbats dy.qt 2018-05-28 1439 0.0008189 0.0008182 0.0181025 0.1345455
tbats dy.qt 2018-05-29 1440 0.0046705 0.0046848 0.3398971 0.5830070
tbats dy.qt 2018-05-30 1440 0.0013349 0.0013351 0.0273525 0.1653860
tbats dy.qt 2018-05-31 1440 0.0015381 0.0015397 0.0399489 0.1998722
tbats dy.qt 2018-06-01 1440 0.0039078 0.0038975 0.2453799 0.4953583
tbats dy.qt 2018-06-02 1 0.0064259 0.0064053 0.4889655 0.6992607
tbats dy.qt 2018-06-04 1439 0.0009630 0.0009623 0.0173505 0.1317215
tbats dy.qt 2018-06-05 1440 0.0006841 0.0006843 0.0091039 0.0954142
tbats dy.qt 2018-06-06 1440 0.0020115 0.0020087 0.0660523 0.2570064
tbats dy.qt 2018-06-07 1440 0.0020819 0.0020849 0.0739407 0.2719204
tbats dy.qt 2018-06-08 1440 0.0016482 0.0016502 0.0492317 0.2218821
tbats dy.qt 2018-06-09 1 0.0015419 0.0015431 0.0286111 0.1691482
tbats dy.qt 2018-06-11 1439 0.0031046 0.0030989 0.1424658 0.3774465
tbats dy.qt 2018-06-12 1440 0.0022461 0.0022432 0.0699830 0.2645429
tbats dy.qt 2018-06-13 1440 0.0013507 0.0013493 0.0326393 0.1806636
tbats dy.qt 2018-06-14 1440 0.0017004 0.0017015 0.0502469 0.2241582
tbats dy.qt 2018-06-15 1440 0.0007257 0.0007257 0.0098517 0.0992559
tbats dy.qt 2018-06-16 1 0.0003011 0.0003011 0.0011100 0.0333167
tbats dy.qt 2018-06-18 1439 0.0014155 0.0014167 0.0292128 0.1709174
tbats dy.qt 2018-06-19 1440 0.0052962 0.0053126 0.4011633 0.6333746
tbats dy.qt 2018-06-20 1440 0.0009143 0.0009136 0.0188498 0.1372944
tbats dy.qt 2018-06-21 1440 0.0019756 0.0019765 0.0688398 0.2623733
tbats dy.qt 2018-06-22 1440 0.0006666 0.0006664 0.0087973 0.0937939
tbats dy.qt 2018-06-23 1 0.0000166 0.0000166 0.0000034 0.0018304
tbats dy.qt 2018-06-25 1439 0.0035492 0.0035565 0.1753105 0.4187009
tbats dy.qt 2018-06-26 1440 0.0016580 0.0016579 0.0462228 0.2149950
tbats dy.qt 2018-06-27 1440 0.0016472 0.0016466 0.0434048 0.2083381
tbats dy.qt 2018-06-28 1440 0.0008681 0.0008678 0.0167567 0.1294476
tbats dy.qt 2018-06-29 1440 0.0015291 0.0015275 0.0394970 0.1987385
tbats dy.qt 2018-06-30 1 0.0017288 0.0017273 0.0364923 0.1910297
tbats dy.qt 2018-07-02 1439 0.0010487 0.0010478 0.0211690 0.1454958
tbats dy.qt 2018-07-03 1440 0.0012694 0.0012706 0.0347796 0.1864930
tbats dy.qt 2018-07-04 1440 0.0010272 0.0010279 0.0163587 0.1279010
tbats dy.qt 2018-07-05 1440 0.0009826 0.0009822 0.0142237 0.1192630
tbats dy.qt 2018-07-06 1440 0.0008012 0.0008016 0.0131406 0.1146326
tbats dy.qt 2018-07-07 1 0.0016441 0.0016454 0.0330902 0.1819072
tbats dy.wk 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.wk 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.wk 2018-01-05 1440 0.0033088 0.0033021 0.1710646 0.4135996
tbats dy.wk 2018-01-06 1 0.0033875 0.0033818 0.1456973 0.3817032
tbats dy.wk 2018-01-08 1439 0.0039391 0.0039311 0.2050746 0.4528517
tbats dy.wk 2018-01-09 1440 0.0033033 0.0033099 0.1699884 0.4122964
tbats dy.wk 2018-01-10 1440 0.0070823 0.0071157 0.8429946 0.9181474
tbats dy.wk 2018-01-11 1440 0.0016816 0.0016808 0.0501580 0.2239599
tbats dy.wk 2018-01-12 1440 0.0009501 0.0009504 0.0195186 0.1397089
tbats dy.wk 2018-01-13 1 0.0021095 0.0021117 0.0550810 0.2346935
tbats dy.wk 2018-01-15 1439 0.0032362 0.0032424 0.1531030 0.3912838
tbats dy.wk 2018-01-16 1440 0.0018544 0.0018525 0.0536890 0.2317088
tbats dy.wk 2018-01-17 1440 0.0026475 0.0026428 0.1169025 0.3419100
tbats dy.wk 2018-01-18 1440 0.0012101 0.0012114 0.0359619 0.1896363
tbats dy.wk 2018-01-19 1440 0.0030660 0.0030718 0.1439751 0.3794405
tbats dy.wk 2018-01-20 1 0.0024655 0.0024686 0.0750436 0.2739409
tbats dy.wk 2018-01-22 1439 0.0009873 0.0009876 0.0163756 0.1279671
tbats dy.wk 2018-01-23 1440 0.0027142 0.0027197 0.1398581 0.3739761
tbats dy.wk 2018-01-24 1440 0.0059675 0.0059923 0.6004194 0.7748674
tbats dy.wk 2018-01-25 1440 0.0021126 0.0021156 0.0835002 0.2889640
tbats dy.wk 2018-01-26 1440 0.0035816 0.0035920 0.2611903 0.5110678
tbats dy.wk 2018-01-27 1 0.0071941 0.0072201 0.6196136 0.7871554
tbats dy.wk 2018-01-29 1439 0.0020564 0.0020535 0.0690647 0.2628016
tbats dy.wk 2018-01-30 1440 0.0017874 0.0017895 0.0517931 0.2275810
tbats dy.wk 2018-01-31 1440 0.0015934 0.0015909 0.0616313 0.2482566
tbats dy.wk 2018-02-01 1440 0.0011203 0.0011196 0.0247870 0.1574389
tbats dy.wk 2018-02-02 1440 0.0048623 0.0048453 0.4069810 0.6379507
tbats dy.wk 2018-02-03 1 0.0081074 0.0080746 0.7850625 0.8860375
tbats dy.wk 2018-02-05 1439 0.0026205 0.0026257 0.1271709 0.3566103
tbats dy.wk 2018-02-06 1440 0.0037161 0.0037067 0.2334475 0.4831641
tbats dy.wk 2018-02-07 1440 0.0023571 0.0023609 0.0938273 0.3063124
tbats dy.wk 2018-02-08 1440 0.0024018 0.0024023 0.1001020 0.3163889
tbats dy.wk 2018-02-09 1440 0.0019856 0.0019845 0.0676120 0.2600231
tbats dy.wk 2018-02-10 1 0.0004671 0.0004670 0.0025805 0.0507983
tbats dy.wk 2018-02-12 1439 0.0011769 0.0011777 0.0201046 0.1417906
tbats dy.wk 2018-02-13 1440 0.0061915 0.0062186 0.6394205 0.7996377
tbats dy.wk 2018-02-14 1440 0.0049932 0.0050093 0.3709035 0.6090185
tbats dy.wk 2018-02-15 1440 0.0047575 0.0047707 0.3015634 0.5491478
tbats dy.wk 2018-02-16 1440 0.0013685 0.0013695 0.0367192 0.1916226
tbats dy.wk 2018-02-17 1 0.0016104 0.0016091 0.0292141 0.1709213
tbats dy.wk 2018-02-19 1439 0.0018805 0.0018784 0.0502621 0.2241921
tbats dy.wk 2018-02-20 1440 0.0039150 0.0039051 0.2257968 0.4751808
tbats dy.wk 2018-02-21 1440 0.0025499 0.0025457 0.0959955 0.3098313
tbats dy.wk 2018-02-22 1440 0.0053737 0.0053926 0.4358756 0.6602088
tbats dy.wk 2018-02-23 1440 0.0010670 0.0010664 0.0194055 0.1393037
tbats dy.wk 2018-02-24 1 0.0012833 0.0012825 0.0187688 0.1369993
tbats dy.wk 2018-02-26 1439 0.0017220 0.0017237 0.0488638 0.2210515
tbats dy.wk 2018-02-27 1440 0.0017673 0.0017643 0.0695155 0.2636579
tbats dy.wk 2018-02-28 1440 0.0028541 0.0028600 0.1382644 0.3718393
tbats dy.wk 2018-03-01 1440 0.0034801 0.0034715 0.1949716 0.4415559
tbats dy.wk 2018-03-02 1440 0.0044533 0.0044669 0.3068255 0.5539184
tbats dy.wk 2018-03-03 1 0.0047465 0.0047578 0.2542418 0.5042239
tbats dy.wk 2018-03-05 1439 0.0020804 0.0020796 0.0656607 0.2562435
tbats dy.wk 2018-03-06 1440 0.0010509 0.0010512 0.0191605 0.1384215
tbats dy.wk 2018-03-07 1440 0.0032838 0.0032906 0.1519181 0.3897667
tbats dy.wk 2018-03-08 1440 0.0006008 0.0006007 0.0064412 0.0802573
tbats dy.wk 2018-03-09 1440 0.0048046 0.0047919 0.2882737 0.5369113
tbats dy.wk 2018-03-10 1 0.0057323 0.0057160 0.3707431 0.6088868
tbats dy.wk 2018-03-12 1439 0.0023320 0.0023352 0.0754334 0.2746514
tbats dy.wk 2018-03-13 1440 0.0028998 0.0028929 0.1571936 0.3964765
tbats dy.wk 2018-03-14 1440 0.0013293 0.0013307 0.0331099 0.1819613
tbats dy.wk 2018-03-15 1440 0.0023848 0.0023884 0.0828737 0.2878779
tbats dy.wk 2018-03-16 1440 0.0033265 0.0033339 0.1664579 0.4079926
tbats dy.wk 2018-03-17 1 0.0033993 0.0034051 0.1306823 0.3615001
tbats dy.wk 2018-03-19 1439 0.0011853 0.0011856 0.0218139 0.1476954
tbats dy.wk 2018-03-20 1440 0.0022842 0.0022809 0.0756495 0.2750445
tbats dy.wk 2018-03-21 1440 0.0017213 0.0017238 0.0554276 0.2354307
tbats dy.wk 2018-03-22 1440 0.0034475 0.0034551 0.1690138 0.4111129
tbats dy.wk 2018-03-23 1440 0.0032325 0.0032386 0.1362323 0.3690966
tbats dy.wk 2018-03-24 1 0.0051900 0.0052035 0.2985701 0.5464157
tbats dy.wk 2018-03-26 1439 0.0028768 0.0028713 0.1192208 0.3452836
tbats dy.wk 2018-03-27 1440 0.0019802 0.0019777 0.0551823 0.2349091
tbats dy.wk 2018-03-28 1440 0.0054936 0.0054675 0.5836692 0.7639825
tbats dy.wk 2018-03-29 1440 0.0026980 0.0027026 0.1069109 0.3269724
tbats dy.wk 2018-03-30 1440 0.0017345 0.0017362 0.0397680 0.1994193
tbats dy.wk 2018-03-31 1 0.0013532 0.0013541 0.0207413 0.1440184
tbats dy.wk 2018-04-02 1439 0.0011295 0.0011310 0.0377658 0.1943343
tbats dy.wk 2018-04-03 1440 0.0027909 0.0027843 0.1512560 0.3889164
tbats dy.wk 2018-04-04 1440 0.0045689 0.0045824 0.3085447 0.5554680
tbats dy.wk 2018-04-05 1440 0.0028622 0.0028559 0.1442011 0.3797382
tbats dy.wk 2018-04-06 1440 0.0041438 0.0041560 0.2821475 0.5311755
tbats dy.wk 2018-04-07 1 0.0090231 0.0090640 0.9480926 0.9737005
tbats dy.wk 2018-04-09 1439 0.0009029 0.0009026 0.0139964 0.1183064
tbats dy.wk 2018-04-10 1440 0.0026414 0.0026370 0.1022641 0.3197875
tbats dy.wk 2018-04-11 1440 0.0020889 0.0020919 0.0689249 0.2625356
tbats dy.wk 2018-04-12 1440 0.0022912 0.0022869 0.0980558 0.3131386
tbats dy.wk 2018-04-13 1440 0.0015215 0.0015197 0.0421439 0.2052899
tbats dy.wk 2018-04-14 1 0.0003216 0.0003215 0.0011913 0.0345146
tbats dy.wk 2018-04-16 1439 0.0012819 0.0012826 0.0235916 0.1535956
tbats dy.wk 2018-04-17 1440 0.0011470 0.0011479 0.0198544 0.1409056
tbats dy.wk 2018-04-18 1440 0.0020339 0.0020315 0.0560938 0.2368412
tbats dy.wk 2018-04-19 1440 0.0012757 0.0012747 0.0223559 0.1495189
tbats dy.wk 2018-04-20 1440 0.0020583 0.0020558 0.0581683 0.2411810
tbats dy.wk 2018-04-21 1 0.0025642 0.0025609 0.0757940 0.2753071
tbats dy.wk 2018-04-23 1439 0.0045527 0.0045371 0.3635059 0.6029145
tbats dy.wk 2018-04-24 1440 0.0025250 0.0025303 0.1285007 0.3584699
tbats dy.wk 2018-04-25 1440 0.0027056 0.0027005 0.1200492 0.3464812
tbats dy.wk 2018-04-26 1440 0.0010286 0.0010293 0.0189224 0.1375586
tbats dy.wk 2018-04-27 1440 0.0013823 0.0013840 0.0406709 0.2016704
tbats dy.wk 2018-04-28 1 0.0036471 0.0036538 0.1593622 0.3992019
tbats dy.wk 2018-04-30 1439 0.0014982 0.0014966 0.0373042 0.1931430
tbats dy.wk 2018-05-01 1440 0.0019000 0.0018972 0.0692574 0.2631681
tbats dy.wk 2018-05-02 1440 0.0028107 0.0028155 0.1187572 0.3446116
tbats dy.wk 2018-05-03 1440 0.0032648 0.0032729 0.1935239 0.4399135
tbats dy.wk 2018-05-04 1440 0.0010356 0.0010365 0.0206815 0.1438108
tbats dy.wk 2018-05-05 1 0.0010683 0.0010689 0.0136074 0.1166506
tbats dy.wk 2018-05-07 1439 0.0010945 0.0010939 0.0213986 0.1462826
tbats dy.wk 2018-05-08 1440 0.0008267 0.0008270 0.0120254 0.1096602
tbats dy.wk 2018-05-09 1440 0.0041100 0.0041001 0.2384303 0.4882932
tbats dy.wk 2018-05-10 1440 0.0013582 0.0013594 0.0377419 0.1942729
tbats dy.wk 2018-05-11 1440 0.0007075 0.0007077 0.0085526 0.0924805
tbats dy.wk 2018-05-12 1 0.0001094 0.0001094 0.0001433 0.0119728
tbats dy.wk 2018-05-14 1439 0.0011874 0.0011865 0.0241623 0.1554422
tbats dy.wk 2018-05-15 1440 0.0030442 0.0030370 0.1747856 0.4180737
tbats dy.wk 2018-05-16 1440 0.0010725 0.0010733 0.0197762 0.1406280
tbats dy.wk 2018-05-17 1440 0.0020402 0.0020379 0.0666682 0.2582019
tbats dy.wk 2018-05-18 1440 0.0011086 0.0011080 0.0198944 0.1410475
tbats dy.wk 2018-05-19 1 0.0001102 0.0001102 0.0001489 0.0122034
tbats dy.wk 2018-05-21 1439 0.0034650 0.0034581 0.1708403 0.4133283
tbats dy.wk 2018-05-22 1440 0.0008503 0.0008507 0.0112249 0.1059478
tbats dy.wk 2018-05-23 1440 0.0057203 0.0057421 0.5342530 0.7309261
tbats dy.wk 2018-05-24 1440 0.0049609 0.0049757 0.3572356 0.5976919
tbats dy.wk 2018-05-25 1440 0.0016314 0.0016297 0.0431855 0.2078112
tbats dy.wk 2018-05-26 1 0.0012219 0.0012212 0.0178230 0.1335029
tbats dy.wk 2018-05-28 1439 0.0008202 0.0008195 0.0181591 0.1347557
tbats dy.wk 2018-05-29 1440 0.0046705 0.0046847 0.3398943 0.5830045
tbats dy.wk 2018-05-30 1440 0.0013343 0.0013346 0.0274149 0.1655744
tbats dy.wk 2018-05-31 1440 0.0015399 0.0015416 0.0400234 0.2000586
tbats dy.wk 2018-06-01 1440 0.0039110 0.0039006 0.2457697 0.4957517
tbats dy.wk 2018-06-02 1 0.0064302 0.0064096 0.4896202 0.6997287
tbats dy.wk 2018-06-04 1439 0.0009617 0.0009610 0.0173077 0.1315586
tbats dy.wk 2018-06-05 1440 0.0006840 0.0006841 0.0090982 0.0953846
tbats dy.wk 2018-06-06 1440 0.0020146 0.0020119 0.0662048 0.2573030
tbats dy.wk 2018-06-07 1440 0.0020963 0.0020993 0.0746822 0.2732804
tbats dy.wk 2018-06-08 1440 0.0016456 0.0016476 0.0490690 0.2215153
tbats dy.wk 2018-06-09 1 0.0015372 0.0015384 0.0284363 0.1686308
tbats dy.wk 2018-06-11 1439 0.0031315 0.0031257 0.1457279 0.3817432
tbats dy.wk 2018-06-12 1440 0.0022426 0.0022397 0.0697875 0.2641732
tbats dy.wk 2018-06-13 1440 0.0013509 0.0013496 0.0326473 0.1806855
tbats dy.wk 2018-06-14 1440 0.0017764 0.0017755 0.0582218 0.2412920
tbats dy.wk 2018-06-15 1440 0.0007286 0.0007286 0.0099876 0.0999379
tbats dy.wk 2018-06-16 1 0.0002951 0.0002950 0.0010657 0.0326457
tbats dy.wk 2018-06-18 1439 0.0026771 0.0026812 0.1024901 0.3201407
tbats dy.wk 2018-06-19 1440 0.0049596 0.0049741 0.3531118 0.5942321
tbats dy.wk 2018-06-20 1440 0.0009217 0.0009210 0.0190658 0.1380790
tbats dy.wk 2018-06-21 1440 0.0019756 0.0019765 0.0688409 0.2623755
tbats dy.wk 2018-06-22 1440 0.0006667 0.0006665 0.0087705 0.0936508
tbats dy.wk 2018-06-23 1 0.0000121 0.0000121 0.0000018 0.0013278
tbats dy.wk 2018-06-25 1439 0.0035498 0.0035570 0.1753596 0.4187597
tbats dy.wk 2018-06-26 1440 0.0016588 0.0016587 0.0462352 0.2150238
tbats dy.wk 2018-06-27 1440 0.0016475 0.0016468 0.0434671 0.2084877
tbats dy.wk 2018-06-28 1440 0.0008682 0.0008679 0.0167661 0.1294839
tbats dy.wk 2018-06-29 1440 0.0015295 0.0015279 0.0395188 0.1987934
tbats dy.wk 2018-06-30 1 0.0017294 0.0017280 0.0365186 0.1910984
tbats dy.wk 2018-07-02 1439 0.0010502 0.0010493 0.0212118 0.1456428
tbats dy.wk 2018-07-03 1440 0.0012720 0.0012733 0.0349115 0.1868461
tbats dy.wk 2018-07-04 1440 0.0010274 0.0010281 0.0163644 0.1279235
tbats dy.wk 2018-07-05 1440 0.0009804 0.0009800 0.0141518 0.1189613
tbats dy.wk 2018-07-06 1440 0.0012390 0.0012403 0.0328218 0.1811678
tbats dy.wk 2018-07-07 1 0.0028486 0.0028526 0.0995788 0.3155610
tbats dy.wk.mo 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.wk.mo 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.wk.mo 2018-01-05 1440 0.0033109 0.0033042 0.1712639 0.4138404
tbats dy.wk.mo 2018-01-06 1 0.0033901 0.0033844 0.1459240 0.3820000
tbats dy.wk.mo 2018-01-08 1439 0.0039391 0.0039311 0.2050746 0.4528517
tbats dy.wk.mo 2018-01-09 1440 0.0012943 0.0012931 0.0419181 0.2047390
tbats dy.wk.mo 2018-01-10 1440 0.0073048 0.0073400 0.8879488 0.9423103
tbats dy.wk.mo 2018-01-11 1440 0.0103775 0.0104334 1.4110712 1.1878852
tbats dy.wk.mo 2018-01-12 1440 0.0130046 0.0130904 2.1649021 1.4713606
tbats dy.wk.mo 2018-01-13 1 0.0147054 0.0148143 2.7456490 1.6570000
tbats dy.wk.mo 2018-01-15 1439 0.0177735 0.0179342 4.0444477 2.0110812
tbats dy.wk.mo 2018-01-16 1440 0.0175204 0.0176763 3.9235329 1.9807910
tbats dy.wk.mo 2018-01-17 1440 0.0173391 0.0174925 3.8604893 1.9648128
tbats dy.wk.mo 2018-01-18 1440 0.0132828 0.0133725 2.2636575 1.5045456
tbats dy.wk.mo 2018-01-19 1440 0.0030752 0.0030811 0.1457174 0.3817295
tbats dy.wk.mo 2018-01-20 1 0.0024662 0.0024692 0.0750853 0.2740170
tbats dy.wk.mo 2018-01-22 1439 0.0009303 0.0009302 0.0176595 0.1328892
tbats dy.wk.mo 2018-01-23 1440 0.0027046 0.0027101 0.1387591 0.3725038
tbats dy.wk.mo 2018-01-24 1440 0.0059686 0.0059934 0.6005825 0.7749726
tbats dy.wk.mo 2018-01-25 1440 0.0021473 0.0021505 0.0859467 0.2931666
tbats dy.wk.mo 2018-01-26 1440 0.0035812 0.0035916 0.2611411 0.5110197
tbats dy.wk.mo 2018-01-27 1 0.0071935 0.0072194 0.6194986 0.7870823
tbats dy.wk.mo 2018-01-29 1439 0.0020564 0.0020535 0.0690656 0.2628034
tbats dy.wk.mo 2018-01-30 1440 0.0017877 0.0017898 0.0518050 0.2276070
tbats dy.wk.mo 2018-01-31 1440 0.0015933 0.0015908 0.0616274 0.2482488
tbats dy.wk.mo 2018-02-01 1440 0.0021337 0.0021305 0.0759029 0.2755049
tbats dy.wk.mo 2018-02-02 1440 0.0043713 0.0043575 0.3328524 0.5769336
tbats dy.wk.mo 2018-02-03 1 0.0071076 0.0070825 0.6045852 0.7775508
tbats dy.wk.mo 2018-02-05 1439 0.0026140 0.0026193 0.1267198 0.3559773
tbats dy.wk.mo 2018-02-06 1440 0.0019389 0.0019386 0.0696284 0.2638719
tbats dy.wk.mo 2018-02-07 1440 0.0023370 0.0023408 0.0920691 0.3034290
tbats dy.wk.mo 2018-02-08 1440 0.0024023 0.0024028 0.1001123 0.3164052
tbats dy.wk.mo 2018-02-09 1440 0.0019902 0.0019891 0.0678287 0.2604395
tbats dy.wk.mo 2018-02-10 1 0.0004776 0.0004774 0.0026968 0.0519307
tbats dy.wk.mo 2018-02-12 1439 0.0011760 0.0011769 0.0200777 0.1416960
tbats dy.wk.mo 2018-02-13 1440 0.0061903 0.0062174 0.6391231 0.7994518
tbats dy.wk.mo 2018-02-14 1440 0.0049948 0.0050108 0.3710984 0.6091785
tbats dy.wk.mo 2018-02-15 1440 0.0047574 0.0047706 0.3015522 0.5491377
tbats dy.wk.mo 2018-02-16 1440 0.0013685 0.0013696 0.0367487 0.1916994
tbats dy.wk.mo 2018-02-17 1 0.0016075 0.0016062 0.0291089 0.1706133
tbats dy.wk.mo 2018-02-19 1439 0.0018805 0.0018784 0.0502614 0.2241906
tbats dy.wk.mo 2018-02-20 1440 0.0039149 0.0039050 0.2257887 0.4751723
tbats dy.wk.mo 2018-02-21 1440 0.0025511 0.0025469 0.0960761 0.3099615
tbats dy.wk.mo 2018-02-22 1440 0.0053754 0.0053942 0.4360783 0.6603622
tbats dy.wk.mo 2018-02-23 1440 0.0010670 0.0010665 0.0194061 0.1393059
tbats dy.wk.mo 2018-02-24 1 0.0012833 0.0012825 0.0187697 0.1370025
tbats dy.wk.mo 2018-02-26 1439 0.0017210 0.0017227 0.0487486 0.2207908
tbats dy.wk.mo 2018-02-27 1440 0.0017591 0.0017561 0.0690596 0.2627920
tbats dy.wk.mo 2018-02-28 1440 0.0028549 0.0028608 0.1383295 0.3719268
tbats dy.wk.mo 2018-03-01 1440 0.0014257 0.0014256 0.0407275 0.2018106
tbats dy.wk.mo 2018-03-02 1440 0.0044566 0.0044703 0.3071276 0.5541909
tbats dy.wk.mo 2018-03-03 1 0.0047484 0.0047597 0.2544465 0.5044269
tbats dy.wk.mo 2018-03-05 1439 0.0020815 0.0020807 0.0656695 0.2562606
tbats dy.wk.mo 2018-03-06 1440 0.0010504 0.0010507 0.0191440 0.1383618
tbats dy.wk.mo 2018-03-07 1440 0.0032837 0.0032905 0.1519105 0.3897570
tbats dy.wk.mo 2018-03-08 1440 0.0006008 0.0006007 0.0064422 0.0802634
tbats dy.wk.mo 2018-03-09 1440 0.0048029 0.0047901 0.2880749 0.5367261
tbats dy.wk.mo 2018-03-10 1 0.0057305 0.0057141 0.3705054 0.6086915
tbats dy.wk.mo 2018-03-12 1439 0.0023398 0.0023430 0.0759610 0.2756103
tbats dy.wk.mo 2018-03-13 1440 0.0028991 0.0028923 0.1571326 0.3963996
tbats dy.wk.mo 2018-03-14 1440 0.0011253 0.0011263 0.0244596 0.1563956
tbats dy.wk.mo 2018-03-15 1440 0.0023833 0.0023870 0.0827863 0.2877261
tbats dy.wk.mo 2018-03-16 1440 0.0033265 0.0033339 0.1664580 0.4079926
tbats dy.wk.mo 2018-03-17 1 0.0033993 0.0034051 0.1306824 0.3615002
tbats dy.wk.mo 2018-03-19 1439 0.0011848 0.0011850 0.0217902 0.1476152
tbats dy.wk.mo 2018-03-20 1440 0.0022841 0.0022809 0.0756456 0.2750375
tbats dy.wk.mo 2018-03-21 1440 0.0017210 0.0017235 0.0554153 0.2354047
tbats dy.wk.mo 2018-03-22 1440 0.0034394 0.0034469 0.1683285 0.4102786
tbats dy.wk.mo 2018-03-23 1440 0.0032312 0.0032373 0.1361282 0.3689556
tbats dy.wk.mo 2018-03-24 1 0.0051886 0.0052021 0.2984034 0.5462631
tbats dy.wk.mo 2018-03-26 1439 0.0028815 0.0028761 0.1195559 0.3457686
tbats dy.wk.mo 2018-03-27 1440 0.0019748 0.0019723 0.0549293 0.2343699
tbats dy.wk.mo 2018-03-28 1440 0.0054901 0.0054639 0.5832300 0.7636949
tbats dy.wk.mo 2018-03-29 1440 0.0026988 0.0027033 0.1069614 0.3270495
tbats dy.wk.mo 2018-03-30 1440 0.0017393 0.0017410 0.0400147 0.2000367
tbats dy.wk.mo 2018-03-31 1 0.0013599 0.0013609 0.0209498 0.1447405
tbats dy.wk.mo 2018-04-02 1439 0.0011293 0.0011308 0.0377876 0.1943902
tbats dy.wk.mo 2018-04-03 1440 0.0027846 0.0027780 0.1506152 0.3880917
tbats dy.wk.mo 2018-04-04 1440 0.0017290 0.0017314 0.0600872 0.2451269
tbats dy.wk.mo 2018-04-05 1440 0.0028603 0.0028540 0.1440676 0.3795623
tbats dy.wk.mo 2018-04-06 1440 0.0017683 0.0017710 0.0637238 0.2524357
tbats dy.wk.mo 2018-04-07 1 0.0041456 0.0041542 0.1981732 0.4451665
tbats dy.wk.mo 2018-04-09 1439 0.0009015 0.0009013 0.0139655 0.1181757
tbats dy.wk.mo 2018-04-10 1440 0.0026385 0.0026340 0.1020143 0.3193967
tbats dy.wk.mo 2018-04-11 1440 0.0020930 0.0020960 0.0691462 0.2629567
tbats dy.wk.mo 2018-04-12 1440 0.0022877 0.0022835 0.0978639 0.3128321
tbats dy.wk.mo 2018-04-13 1440 0.0015214 0.0015196 0.0421369 0.2052728
tbats dy.wk.mo 2018-04-14 1 0.0003214 0.0003213 0.0011897 0.0344924
tbats dy.wk.mo 2018-04-16 1439 0.0012850 0.0012857 0.0236954 0.1539331
tbats dy.wk.mo 2018-04-17 1440 0.0006960 0.0006963 0.0083356 0.0912998
tbats dy.wk.mo 2018-04-18 1440 0.0020360 0.0020336 0.0561993 0.2370638
tbats dy.wk.mo 2018-04-19 1440 0.0012646 0.0012637 0.0219771 0.1482466
tbats dy.wk.mo 2018-04-20 1440 0.0020513 0.0020488 0.0578264 0.2404713
tbats dy.wk.mo 2018-04-21 1 0.0025569 0.0025537 0.0753680 0.2745324
tbats dy.wk.mo 2018-04-23 1439 0.0045574 0.0045417 0.3641014 0.6034082
tbats dy.wk.mo 2018-04-24 1440 0.0011936 0.0011923 0.0310049 0.1760822
tbats dy.wk.mo 2018-04-25 1440 0.0027036 0.0026985 0.1198454 0.3461869
tbats dy.wk.mo 2018-04-26 1440 0.0010284 0.0010292 0.0189175 0.1375410
tbats dy.wk.mo 2018-04-27 1440 0.0008731 0.0008737 0.0162998 0.1276708
tbats dy.wk.mo 2018-04-28 1 0.0022293 0.0022318 0.0593742 0.2436682
tbats dy.wk.mo 2018-04-30 1439 0.0014981 0.0014966 0.0373015 0.1931360
tbats dy.wk.mo 2018-05-01 1440 0.0019013 0.0018985 0.0693480 0.2633402
tbats dy.wk.mo 2018-05-02 1440 0.0006549 0.0006552 0.0081634 0.0903516
tbats dy.wk.mo 2018-05-03 1440 0.0032216 0.0032295 0.1897824 0.4356402
tbats dy.wk.mo 2018-05-04 1440 0.0010331 0.0010340 0.0206103 0.1435629
tbats dy.wk.mo 2018-05-05 1 0.0010655 0.0010661 0.0135366 0.1163469
tbats dy.wk.mo 2018-05-07 1439 0.0010947 0.0010942 0.0214076 0.1463134
tbats dy.wk.mo 2018-05-08 1440 0.0008231 0.0008230 0.0123015 0.1109120
tbats dy.wk.mo 2018-05-09 1440 0.0041063 0.0040964 0.2378793 0.4877287
tbats dy.wk.mo 2018-05-10 1440 0.0013571 0.0013583 0.0376889 0.1941362
tbats dy.wk.mo 2018-05-11 1440 0.0007071 0.0007073 0.0085426 0.0924261
tbats dy.wk.mo 2018-05-12 1 0.0001084 0.0001084 0.0001407 0.0118627
tbats dy.wk.mo 2018-05-14 1439 0.0011015 0.0011009 0.0199802 0.1413512
tbats dy.wk.mo 2018-05-15 1440 0.0030324 0.0030251 0.1739168 0.4170333
tbats dy.wk.mo 2018-05-16 1440 0.0010804 0.0010812 0.0199944 0.1414014
tbats dy.wk.mo 2018-05-17 1440 0.0020307 0.0020285 0.0654388 0.2558101
tbats dy.wk.mo 2018-05-18 1440 0.0011077 0.0011070 0.0198553 0.1409090
tbats dy.wk.mo 2018-05-19 1 0.0001121 0.0001121 0.0001542 0.0124188
tbats dy.wk.mo 2018-05-21 1439 0.0034640 0.0034570 0.1707487 0.4132175
tbats dy.wk.mo 2018-05-22 1440 0.0008634 0.0008638 0.0115268 0.1073628
tbats dy.wk.mo 2018-05-23 1440 0.0057152 0.0057369 0.5334848 0.7304004
tbats dy.wk.mo 2018-05-24 1440 0.0049613 0.0049761 0.3572843 0.5977326
tbats dy.wk.mo 2018-05-25 1440 0.0016297 0.0016280 0.0431029 0.2076123
tbats dy.wk.mo 2018-05-26 1 0.0012197 0.0012189 0.0177573 0.1332567
tbats dy.wk.mo 2018-05-28 1439 0.0008197 0.0008190 0.0181354 0.1346679
tbats dy.wk.mo 2018-05-29 1440 0.0046713 0.0046855 0.3399934 0.5830895
tbats dy.wk.mo 2018-05-30 1440 0.0013350 0.0013353 0.0273422 0.1653547
tbats dy.wk.mo 2018-05-31 1440 0.0015382 0.0015399 0.0399556 0.1998889
tbats dy.wk.mo 2018-06-01 1440 0.0039014 0.0038911 0.2445897 0.4945602
tbats dy.wk.mo 2018-06-02 1 0.0064171 0.0063966 0.4876375 0.6983105
tbats dy.wk.mo 2018-06-04 1439 0.0009632 0.0009625 0.0173568 0.1317451
tbats dy.wk.mo 2018-06-05 1440 0.0006842 0.0006843 0.0091050 0.0954199
tbats dy.wk.mo 2018-06-06 1440 0.0020099 0.0020072 0.0659765 0.2568589
tbats dy.wk.mo 2018-06-07 1440 0.0020891 0.0020921 0.0743108 0.2726002
tbats dy.wk.mo 2018-06-08 1440 0.0016476 0.0016495 0.0491911 0.2217906
tbats dy.wk.mo 2018-06-09 1 0.0015407 0.0015419 0.0285672 0.1690183
tbats dy.wk.mo 2018-06-11 1439 0.0031091 0.0031034 0.1430100 0.3781666
tbats dy.wk.mo 2018-06-12 1440 0.0022452 0.0022423 0.0699336 0.2644497
tbats dy.wk.mo 2018-06-13 1440 0.0013507 0.0013493 0.0326392 0.1806632
tbats dy.wk.mo 2018-06-14 1440 0.0017034 0.0017045 0.0503907 0.2244787
tbats dy.wk.mo 2018-06-15 1440 0.0007262 0.0007262 0.0098580 0.0992877
tbats dy.wk.mo 2018-06-16 1 0.0002990 0.0002990 0.0010945 0.0330835
tbats dy.wk.mo 2018-06-18 1439 0.0014148 0.0014160 0.0291882 0.1708456
tbats dy.wk.mo 2018-06-19 1440 0.0052965 0.0053130 0.4012069 0.6334090
tbats dy.wk.mo 2018-06-20 1440 0.0009220 0.0009213 0.0190946 0.1381832
tbats dy.wk.mo 2018-06-21 1440 0.0019756 0.0019765 0.0688416 0.2623768
tbats dy.wk.mo 2018-06-22 1440 0.0006668 0.0006666 0.0087552 0.0935694
tbats dy.wk.mo 2018-06-23 1 0.0000094 0.0000094 0.0000011 0.0010375
tbats dy.wk.mo 2018-06-25 1439 0.0035453 0.0035526 0.1749720 0.4182966
tbats dy.wk.mo 2018-06-26 1440 0.0016594 0.0016593 0.0462447 0.2150457
tbats dy.wk.mo 2018-06-27 1440 0.0016473 0.0016467 0.0434331 0.2084062
tbats dy.wk.mo 2018-06-28 1440 0.0008683 0.0008680 0.0167759 0.1295220
tbats dy.wk.mo 2018-06-29 1440 0.0015291 0.0015275 0.0395008 0.1987482
tbats dy.wk.mo 2018-06-30 1 0.0017289 0.0017274 0.0364968 0.1910414
tbats dy.wk.mo 2018-07-02 1439 0.0010502 0.0010493 0.0212129 0.1456465
tbats dy.wk.mo 2018-07-03 1440 0.0012721 0.0012733 0.0349143 0.1868537
tbats dy.wk.mo 2018-07-04 1440 0.0010274 0.0010281 0.0163645 0.1279240
tbats dy.wk.mo 2018-07-05 1440 0.0009804 0.0009800 0.0141517 0.1189611
tbats dy.wk.mo 2018-07-06 1440 0.0007993 0.0007997 0.0130552 0.1142594
tbats dy.wk.mo 2018-07-07 1 0.0016373 0.0016386 0.0328181 0.1811577
tbats dy.yr 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.yr 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.yr 2018-01-05 1440 0.0033109 0.0033042 0.1712639 0.4138404
tbats dy.yr 2018-01-06 1 0.0033901 0.0033844 0.1459240 0.3820000
tbats dy.yr 2018-01-08 1439 0.0039391 0.0039311 0.2050746 0.4528517
tbats dy.yr 2018-01-09 1440 0.0012943 0.0012931 0.0419181 0.2047390
tbats dy.yr 2018-01-10 1440 0.0073048 0.0073400 0.8879488 0.9423103
tbats dy.yr 2018-01-11 1440 0.0103775 0.0104334 1.4110712 1.1878852
tbats dy.yr 2018-01-12 1440 0.0130046 0.0130904 2.1649021 1.4713606
tbats dy.yr 2018-01-13 1 0.0147054 0.0148143 2.7456490 1.6570000
tbats dy.yr 2018-01-15 1439 0.0177735 0.0179342 4.0444477 2.0110812
tbats dy.yr 2018-01-16 1440 0.0175204 0.0176763 3.9235329 1.9807910
tbats dy.yr 2018-01-17 1440 0.0173391 0.0174925 3.8604893 1.9648128
tbats dy.yr 2018-01-18 1440 0.0132828 0.0133725 2.2636575 1.5045456
tbats dy.yr 2018-01-19 1440 0.0169647 0.0171110 3.6821392 1.9188901
tbats dy.yr 2018-01-20 1 0.0163738 0.0165090 3.4040250 1.8450000
tbats dy.yr 2018-01-22 1439 0.0164475 0.0165846 3.4523110 1.8580396
tbats dy.yr 2018-01-23 1440 0.0180156 0.0181820 4.1856644 2.0458896
tbats dy.yr 2018-01-24 1440 0.0268881 0.0272614 9.3470597 3.0572961
tbats dy.yr 2018-01-25 1440 0.0322722 0.0328036 13.2754674 3.6435515
tbats dy.yr 2018-01-26 1440 0.0318377 0.0323591 13.0263583 3.6092047
tbats dy.yr 2018-01-27 1 0.0359514 0.0366094 16.4106010 4.0510000
tbats dy.yr 2018-01-29 1439 0.0339983 0.0345871 14.6966838 3.8336254
tbats dy.yr 2018-01-30 1440 0.0346458 0.0352574 15.2604667 3.9064647
tbats dy.yr 2018-01-31 1440 0.0333584 0.0339260 14.1707246 3.7644023
tbats dy.yr 2018-02-01 1440 0.0288410 0.0292640 10.5843271 3.2533563
tbats dy.yr 2018-02-02 1440 0.0249175 0.0252362 7.9895620 2.8265813
tbats dy.yr 2018-02-03 1 0.0222400 0.0224901 6.2800360 2.5060000
tbats dy.yr 2018-02-05 1439 0.0247250 0.0250364 7.8101566 2.7946657
tbats dy.yr 2018-02-06 1440 0.0316136 0.0321241 12.7564999 3.5716243
tbats dy.yr 2018-02-07 1440 0.0298147 0.0302673 11.3204578 3.3645888
tbats dy.yr 2018-02-08 1440 0.0295570 0.0300045 11.1915858 3.3453828
tbats dy.yr 2018-02-09 1440 0.0340752 0.0346683 14.8008132 3.8471825
tbats dy.yr 2018-02-10 1 0.0344693 0.0350738 15.0854560 3.8840000
tbats dy.yr 2018-02-12 1439 0.0355512 0.0361948 16.0525253 4.0065603
tbats dy.yr 2018-02-13 1440 0.0415012 0.0423895 22.0797777 4.6989124
tbats dy.yr 2018-02-14 1440 0.0478455 0.0490216 29.1477209 5.3988629
tbats dy.yr 2018-02-15 1440 0.0548283 0.0563755 38.2107906 6.1814877
tbats dy.yr 2018-02-16 1440 0.0585071 0.0602717 43.4960112 6.5951506
tbats dy.yr 2018-02-17 1 0.0565673 0.0582138 40.6278760 6.3740000
tbats dy.yr 2018-02-19 1439 0.0550766 0.0566373 38.5369395 6.2078128
tbats dy.yr 2018-02-20 1440 0.0503269 0.0516282 32.2105882 5.6754373
tbats dy.yr 2018-02-21 1440 0.0451023 0.0461438 25.8503062 5.0843196
tbats dy.yr 2018-02-22 1440 0.0486687 0.0498868 30.1747998 5.4931594
tbats dy.yr 2018-02-23 1440 0.0520678 0.0534602 34.4368323 5.8682904
tbats dy.yr 2018-02-24 1 0.0513756 0.0527301 33.5125210 5.7890000
tbats dy.yr 2018-02-26 1439 0.0523297 0.0537373 34.8061849 5.8996767
tbats dy.yr 2018-02-27 1440 0.0495722 0.0508339 31.2421536 5.5894681
tbats dy.yr 2018-02-28 1440 0.0500147 0.0512998 31.8154528 5.6405188
tbats dy.yr 2018-03-01 1440 0.0528801 0.0543178 35.5425360 5.9617561
tbats dy.yr 2018-03-02 1440 0.0614139 0.0633632 47.9736591 6.9263020
tbats dy.yr 2018-03-03 1 0.0617146 0.0636796 48.3581160 6.9540000
tbats dy.yr 2018-03-05 1439 0.0618393 0.0638152 48.6191767 6.9727453
tbats dy.yr 2018-03-06 1440 0.0576352 0.0593462 42.1946350 6.4957398
tbats dy.yr 2018-03-07 1440 0.0611436 0.0630732 47.4988149 6.8919384
tbats dy.yr 2018-03-08 1440 0.0583970 0.0601537 43.3046139 6.5806241
tbats dy.yr 2018-03-09 1440 0.0528147 0.0542485 35.4452447 5.9535909
tbats dy.yr 2018-03-10 1 0.0519302 0.0533146 34.2400523 5.8515000
tbats dy.yr 2018-03-12 1439 0.0539580 0.0554551 36.9899617 6.0819373
tbats dy.yr 2018-03-13 1440 0.0530344 0.0544823 35.7881548 5.9823202
tbats dy.yr 2018-03-14 1440 0.0552759 0.0568478 38.8117093 6.2299044
tbats dy.yr 2018-03-15 1440 0.0586386 0.0604106 43.6777665 6.6089157
tbats dy.yr 2018-03-16 1440 0.0593666 0.0611845 44.7900387 6.6925360
tbats dy.yr 2018-03-17 1 0.0594382 0.0612588 44.8565063 6.6975000
tbats dy.yr 2018-03-19 1439 0.0596944 0.0615318 45.2649130 6.7279204
tbats dy.yr 2018-03-20 1440 0.0564654 0.0581070 40.5082290 6.3646075
tbats dy.yr 2018-03-21 1440 0.0561626 0.0577863 40.0706968 6.3301419
tbats dy.yr 2018-03-22 1440 0.0620814 0.0640717 48.9713686 6.9979546
tbats dy.yr 2018-03-23 1440 0.0686503 0.0710915 59.8598804 7.7369167
tbats dy.yr 2018-03-24 1 0.0705005 0.0730765 63.1071360 7.9440000
tbats dy.yr 2018-03-26 1439 0.0678501 0.0702341 58.4820533 7.6473560
tbats dy.yr 2018-03-27 1440 0.0627230 0.0647543 49.9636189 7.0684948
tbats dy.yr 2018-03-28 1440 0.0600072 0.0618740 45.9681799 6.7799838
tbats dy.yr 2018-03-29 1440 0.0542516 0.0557653 37.3936332 6.1150334
tbats dy.yr 2018-03-30 1440 0.0569742 0.0586453 41.2251844 6.4206841
tbats dy.yr 2018-03-31 1 0.0567403 0.0583971 40.8768423 6.3935000
tbats dy.yr 2018-04-02 1439 0.0573346 0.0590282 41.7708572 6.4630378
tbats dy.yr 2018-04-03 1440 0.0578294 0.0595547 42.5392525 6.5222122
tbats dy.yr 2018-04-04 1440 0.0551418 0.0567069 38.6452777 6.2165326
tbats dy.yr 2018-04-05 1440 0.0496996 0.0509684 31.4156586 5.6049673
tbats dy.yr 2018-04-06 1440 0.0486093 0.0498215 30.0316667 5.4801156
tbats dy.yr 2018-04-07 1 0.0509585 0.0522908 32.9705640 5.7420000
tbats dy.yr 2018-04-09 1439 0.0505655 0.0518776 32.4760320 5.6987746
tbats dy.yr 2018-04-10 1440 0.0500467 0.0513325 31.8318784 5.6419747
tbats dy.yr 2018-04-11 1440 0.0505795 0.0518926 32.5015772 5.7010155
tbats dy.yr 2018-04-12 1440 0.0500981 0.0513869 31.9055113 5.6484964
tbats dy.yr 2018-04-13 1440 0.0462221 0.0473164 27.1456958 5.2101531
tbats dy.yr 2018-04-14 1 0.0472533 0.0483967 28.3503003 5.3245000
tbats dy.yr 2018-04-16 1439 0.0480113 0.0491929 29.2834761 5.4114209
tbats dy.yr 2018-04-17 1440 0.0499536 0.0512334 31.6868643 5.6291087
tbats dy.yr 2018-04-18 1440 0.0484214 0.0496232 29.7780866 5.4569301
tbats dy.yr 2018-04-19 1440 0.0471391 0.0482772 28.2180613 5.3120675
tbats dy.yr 2018-04-20 1440 0.0451939 0.0462391 25.9423588 5.0933642
tbats dy.yr 2018-04-21 1 0.0447107 0.0457331 25.3814440 5.0380000
tbats dy.yr 2018-04-23 1439 0.0403732 0.0412102 20.8190835 4.5627934
tbats dy.yr 2018-04-24 1440 0.0342189 0.0348152 14.8829677 3.8578450
tbats dy.yr 2018-04-25 1440 0.0316863 0.0321978 12.7813704 3.5751042
tbats dy.yr 2018-04-26 1440 0.0298544 0.0303070 11.3227741 3.3649330
tbats dy.yr 2018-04-27 1440 0.0305881 0.0310636 11.8910975 3.4483471
tbats dy.yr 2018-04-28 1 0.0321441 0.0326692 13.1188840 3.6220000
tbats dy.yr 2018-04-30 1439 0.0306979 0.0311769 11.9756958 3.4605918
tbats dy.yr 2018-05-01 1440 0.0279642 0.0283622 9.9632937 3.1564685
tbats dy.yr 2018-05-02 1440 0.0253920 0.0257187 8.1921161 2.8621873
tbats dy.yr 2018-05-03 1440 0.0283529 0.0287634 10.2724713 3.2050696
tbats dy.yr 2018-05-04 1440 0.0319213 0.0324394 12.9459186 3.5980437
tbats dy.yr 2018-05-05 1 0.0319799 0.0324996 12.9852123 3.6035000
tbats dy.yr 2018-05-07 1439 0.0314228 0.0319251 12.5540949 3.5431758
tbats dy.yr 2018-05-08 1440 0.0322355 0.0327640 13.2033796 3.6336455
tbats dy.yr 2018-05-09 1440 0.0276971 0.0280882 9.7920757 3.1292292
tbats dy.yr 2018-05-10 1440 0.0268879 0.0272554 9.2076423 3.0344097
tbats dy.yr 2018-05-11 1440 0.0295278 0.0299706 11.0766470 3.3281597
tbats dy.yr 2018-05-12 1 0.0292332 0.0296669 10.8504360 3.2940000
tbats dy.yr 2018-05-14 1439 0.0285502 0.0289643 10.3633711 3.2192190
tbats dy.yr 2018-05-15 1440 0.0238221 0.0241119 7.2687680 2.6960653
tbats dy.yr 2018-05-16 1440 0.0217231 0.0219618 5.9972995 2.4489384
tbats dy.yr 2018-05-17 1440 0.0190188 0.0192032 4.6376754 2.1535263
tbats dy.yr 2018-05-18 1440 0.0162332 0.0163665 3.3582588 1.8325553
tbats dy.yr 2018-05-19 1 0.0171015 0.0172490 3.7133290 1.9270000
tbats dy.yr 2018-05-21 1439 0.0136949 0.0137903 2.4048528 1.5507588
tbats dy.yr 2018-05-22 1440 0.0152313 0.0153483 2.9492781 1.7173462
tbats dy.yr 2018-05-23 1440 0.0214290 0.0216665 5.9628655 2.4418979
tbats dy.yr 2018-05-24 1440 0.0278934 0.0282903 9.9377873 3.1524256
tbats dy.yr 2018-05-25 1440 0.0289092 0.0293338 10.6257407 3.2597148
tbats dy.yr 2018-05-26 1 0.0292155 0.0296486 10.8372640 3.2920000
tbats dy.yr 2018-05-28 1439 0.0287038 0.0291224 10.4758182 3.2366369
tbats dy.yr 2018-05-29 1440 0.0334591 0.0340318 14.2958765 3.7809888
tbats dy.yr 2018-05-30 1440 0.0348500 0.0354691 15.4474376 3.9303228
tbats dy.yr 2018-05-31 1440 0.0349467 0.0355687 15.5187281 3.9393817
tbats dy.yr 2018-06-01 1440 0.0305646 0.0310420 11.9334252 3.4544790
tbats dy.yr 2018-06-02 1 0.0280529 0.0284520 9.9919210 3.1610000
tbats dy.yr 2018-06-04 1439 0.0272565 0.0276335 9.4419288 3.0727722
tbats dy.yr 2018-06-05 1440 0.0256171 0.0259498 8.3406851 2.8880244
tbats dy.yr 2018-06-06 1440 0.0236709 0.0239552 7.1314719 2.6704816
tbats dy.yr 2018-06-07 1440 0.0241939 0.0244910 7.4534678 2.7301040
tbats dy.yr 2018-06-08 1440 0.0278386 0.0282325 9.8637981 3.1406684
tbats dy.yr 2018-06-09 1 0.0279331 0.0283287 9.9067563 3.1475000
tbats dy.yr 2018-06-11 1439 0.0253705 0.0256989 8.2308141 2.8689395
tbats dy.yr 2018-06-12 1440 0.0213017 0.0215314 5.7706147 2.4022104
tbats dy.yr 2018-06-13 1440 0.0191762 0.0193623 4.6803909 2.1634211
tbats dy.yr 2018-06-14 1440 0.0215490 0.0217855 5.9378640 2.4367733
tbats dy.yr 2018-06-15 1440 0.0182994 0.0184688 4.2613323 2.0642995
tbats dy.yr 2018-06-16 1 0.0178781 0.0180393 4.0582102 2.0145000
tbats dy.yr 2018-06-18 1439 0.0192425 0.0194297 4.7069267 2.1695453
tbats dy.yr 2018-06-19 1440 0.0241006 0.0243970 7.4340138 2.7265388
tbats dy.yr 2018-06-20 1440 0.0224995 0.0227559 6.4389355 2.5375058
tbats dy.yr 2018-06-21 1440 0.0208018 0.0210232 5.5623215 2.3584574
tbats dy.yr 2018-06-22 1440 0.0236769 0.0239609 7.1257653 2.6694129
tbats dy.yr 2018-06-23 1 0.0238995 0.0241886 7.2522490 2.6930000
tbats dy.yr 2018-06-25 1439 0.0273632 0.0277437 9.5296900 3.0870196
tbats dy.yr 2018-06-26 1440 0.0261115 0.0264588 8.7023493 2.9499745
tbats dy.yr 2018-06-27 1440 0.0231693 0.0234426 6.8580605 2.6187899
tbats dy.yr 2018-06-28 1440 0.0212360 0.0214646 5.7420078 2.3962487
tbats dy.yr 2018-06-29 1440 0.0179686 0.0181321 4.1138114 2.0282533
tbats dy.yr 2018-06-30 1 0.0176784 0.0178360 3.9680640 1.9920000
tbats dy.yr 2018-07-02 1439 0.0166676 0.0168080 3.5355166 1.8802969
tbats dy.yr 2018-07-03 1440 0.0167358 0.0168780 3.5806198 1.8922526
tbats dy.yr 2018-07-04 1440 0.0196316 0.0198264 4.8968547 2.2128838
tbats dy.yr 2018-07-05 1440 0.0009931 0.0009929 0.0174183 0.1319785
tbats dy.yr 2018-07-06 1440 0.0007986 0.0007990 0.0130234 0.1141202
tbats dy.yr 2018-07-07 1 0.0016348 0.0016361 0.0327167 0.1808775
ts mo.1440 2018-01-03 1439 0.0006195 0.0006192 0.0089053 0.0943678
ts mo.1440 2018-01-04 1440 0.0018933 0.0018912 0.0524653 0.2290530
ts mo.1440 2018-01-05 1440 0.0026655 0.0026607 0.1209434 0.3477691
ts mo.1440 2018-01-06 1 0.0028170 0.0028130 0.1008702 0.3176007
ts mo.1440 2018-01-08 1439 0.0006855 0.0006853 0.0096424 0.0981956
ts mo.1440 2018-01-09 1440 0.0033514 0.0033582 0.1742534 0.4174367
ts mo.1440 2018-01-10 1440 0.0068046 0.0068360 0.7940909 0.8911178
ts mo.1440 2018-01-11 1440 0.0021101 0.0021080 0.0753938 0.2745793
ts mo.1440 2018-01-12 1440 0.0009539 0.0009540 0.0195391 0.1397822
ts mo.1440 2018-01-13 1 0.0020477 0.0020498 0.0518981 0.2278115
ts mo.1440 2018-01-15 1439 0.0031322 0.0031379 0.1405843 0.3749457
ts mo.1440 2018-01-16 1440 0.0019964 0.0019941 0.0615712 0.2481354
ts mo.1440 2018-01-17 1440 0.0025769 0.0025725 0.1147781 0.3387891
ts mo.1440 2018-01-18 1440 0.0011133 0.0011144 0.0300424 0.1733274
ts mo.1440 2018-01-19 1440 0.0032498 0.0032559 0.1518261 0.3896487
ts mo.1440 2018-01-20 1 0.0025869 0.0025903 0.0826358 0.2874644
ts mo.1440 2018-01-22 1439 0.0011021 0.0011013 0.0292844 0.1711268
ts mo.1440 2018-01-23 1440 0.0024768 0.0024813 0.1120652 0.3347614
ts mo.1440 2018-01-24 1440 0.0056818 0.0057036 0.5273406 0.7261822
ts mo.1440 2018-01-25 1440 0.0017824 0.0017840 0.0590921 0.2430887
ts mo.1440 2018-01-26 1440 0.0029631 0.0029692 0.1731140 0.4160698
ts mo.1440 2018-01-27 1 0.0071288 0.0071543 0.6083229 0.7799506
ts mo.1440 2018-01-29 1439 0.0026183 0.0026131 0.1226401 0.3502001
ts mo.1440 2018-01-30 1440 0.0014954 0.0014969 0.0368227 0.1918925
ts mo.1440 2018-01-31 1440 0.0020807 0.0020765 0.1022261 0.3197282
ts mo.1440 2018-02-01 1440 0.0027513 0.0027460 0.1272960 0.3567856
ts mo.1440 2018-02-02 1440 0.0045591 0.0045437 0.3712070 0.6092676
ts mo.1440 2018-02-03 1 0.0070416 0.0070169 0.5934794 0.7703762
ts mo.1440 2018-02-05 1439 0.0027148 0.0027202 0.1318728 0.3631429
ts mo.1440 2018-02-06 1440 0.0019095 0.0019104 0.0742091 0.2724135
ts mo.1440 2018-02-07 1440 0.0022077 0.0022110 0.0816195 0.2856913
ts mo.1440 2018-02-08 1440 0.0027822 0.0027830 0.1338333 0.3658324
ts mo.1440 2018-02-09 1440 0.0020346 0.0020348 0.0735302 0.2711646
ts mo.1440 2018-02-10 1 0.0004782 0.0004781 0.0027043 0.0520031
ts mo.1440 2018-02-12 1439 0.0015525 0.0015542 0.0399390 0.1998473
ts mo.1440 2018-02-13 1440 0.0066730 0.0067043 0.7404211 0.8604773
ts mo.1440 2018-02-14 1440 0.0047852 0.0048002 0.3478155 0.5897589
ts mo.1440 2018-02-15 1440 0.0045488 0.0045610 0.2795891 0.5287619
ts mo.1440 2018-02-16 1440 0.0011755 0.0011760 0.0261509 0.1617124
ts mo.1440 2018-02-17 1 0.0016106 0.0016093 0.0292211 0.1709417
ts mo.1440 2018-02-19 1439 0.0023436 0.0023402 0.0782012 0.2796448
ts mo.1440 2018-02-20 1440 0.0043016 0.0042902 0.2594391 0.5093516
ts mo.1440 2018-02-21 1440 0.0028693 0.0028638 0.1267526 0.3560234
ts mo.1440 2018-02-22 1440 0.0050996 0.0051170 0.4014508 0.6336014
ts mo.1440 2018-02-23 1440 0.0012161 0.0012151 0.0268283 0.1637934
ts mo.1440 2018-02-24 1 0.0012834 0.0012826 0.0187718 0.1370103
ts mo.1440 2018-02-26 1439 0.0017900 0.0017912 0.0471587 0.2171605
ts mo.1440 2018-02-27 1440 0.0020308 0.0020271 0.0870698 0.2950759
ts mo.1440 2018-02-28 1440 0.0025601 0.0025654 0.1226653 0.3502360
ts mo.1440 2018-03-01 1440 0.0016189 0.0016184 0.0454563 0.2132049
ts mo.1440 2018-03-02 1440 0.0048308 0.0048463 0.3484952 0.5903348
ts mo.1440 2018-03-03 1 0.0047455 0.0047568 0.2541284 0.5041115
ts mo.1440 2018-03-05 1439 0.0017973 0.0017957 0.0613283 0.2476455
ts mo.1440 2018-03-06 1440 0.0011799 0.0011796 0.0240326 0.1550244
ts mo.1440 2018-03-07 1440 0.0029808 0.0029865 0.1275201 0.3570996
ts mo.1440 2018-03-08 1440 0.0011034 0.0011026 0.0179415 0.1339457
ts mo.1440 2018-03-09 1440 0.0055607 0.0055439 0.3783486 0.6151004
ts mo.1440 2018-03-10 1 0.0057301 0.0057137 0.3704495 0.6086456
ts mo.1440 2018-03-12 1439 0.0020550 0.0020577 0.0631336 0.2512641
ts mo.1440 2018-03-13 1440 0.0033638 0.0033549 0.2066242 0.4545593
ts mo.1440 2018-03-14 1440 0.0013668 0.0013683 0.0358629 0.1893749
ts mo.1440 2018-03-15 1440 0.0023583 0.0023619 0.0818605 0.2861128
ts mo.1440 2018-03-16 1440 0.0029534 0.0029595 0.1367507 0.3697982
ts mo.1440 2018-03-17 1 0.0033997 0.0034055 0.1307075 0.3615350
ts mo.1440 2018-03-19 1439 0.0009580 0.0009578 0.0155765 0.1248059
ts mo.1440 2018-03-20 1440 0.0027241 0.0027197 0.1017598 0.3189981
ts mo.1440 2018-03-21 1440 0.0015818 0.0015840 0.0511097 0.2260745
ts mo.1440 2018-03-22 1440 0.0031871 0.0031939 0.1531523 0.3913467
ts mo.1440 2018-03-23 1440 0.0029535 0.0029586 0.1137222 0.3372273
ts mo.1440 2018-03-24 1 0.0051860 0.0051995 0.2981093 0.5459939
ts mo.1440 2018-03-26 1439 0.0032447 0.0032384 0.1373792 0.3706470
ts mo.1440 2018-03-27 1440 0.0024021 0.0023986 0.0768881 0.2772870
ts mo.1440 2018-03-28 1440 0.0051964 0.0051729 0.5236254 0.7236196
ts mo.1440 2018-03-29 1440 0.0026082 0.0026127 0.1093110 0.3306221
ts mo.1440 2018-03-30 1440 0.0016661 0.0016677 0.0383483 0.1958271
ts mo.1440 2018-03-31 1 0.0013534 0.0013543 0.0207494 0.1440466
ts mo.1440 2018-04-02 1439 0.0015342 0.0015357 0.0505865 0.2249144
ts mo.1440 2018-04-03 1440 0.0027881 0.0027819 0.1417164 0.3764524
ts mo.1440 2018-04-04 1440 0.0015284 0.0015305 0.0542717 0.2329628
ts mo.1440 2018-04-05 1440 0.0034683 0.0034604 0.1816545 0.4262094
ts mo.1440 2018-04-06 1440 0.0017739 0.0017764 0.0625194 0.2500388
ts mo.1440 2018-04-07 1 0.0041446 0.0041532 0.1980759 0.4450571
ts mo.1440 2018-04-09 1439 0.0012144 0.0012137 0.0240610 0.1551160
ts mo.1440 2018-04-10 1440 0.0027224 0.0027177 0.1076017 0.3280269
ts mo.1440 2018-04-11 1440 0.0020798 0.0020828 0.0707359 0.2659621
ts mo.1440 2018-04-12 1440 0.0023498 0.0023454 0.0995258 0.3154771
ts mo.1440 2018-04-13 1440 0.0014644 0.0014626 0.0411205 0.2027819
ts mo.1440 2018-04-14 1 0.0003313 0.0003313 0.0012645 0.0355595
ts mo.1440 2018-04-16 1439 0.0016840 0.0016851 0.0369468 0.1922154
ts mo.1440 2018-04-17 1440 0.0008842 0.0008848 0.0127984 0.1131300
ts mo.1440 2018-04-18 1440 0.0018057 0.0018037 0.0461242 0.2147655
ts mo.1440 2018-04-19 1440 0.0008831 0.0008826 0.0120799 0.1099087
ts mo.1440 2018-04-20 1440 0.0015960 0.0015944 0.0358682 0.1893889
ts mo.1440 2018-04-21 1 0.0025516 0.0025484 0.0750545 0.2739607
ts mo.1440 2018-04-23 1439 0.0040202 0.0040065 0.3198618 0.5655633
ts mo.1440 2018-04-24 1440 0.0008583 0.0008575 0.0187194 0.1368189
ts mo.1440 2018-04-25 1440 0.0023138 0.0023097 0.0966523 0.3108895
ts mo.1440 2018-04-26 1440 0.0013040 0.0013052 0.0297695 0.1725384
ts mo.1440 2018-04-27 1440 0.0009764 0.0009771 0.0201477 0.1419426
ts mo.1440 2018-04-28 1 0.0022244 0.0022269 0.0591127 0.2431310
ts mo.1440 2018-04-30 1439 0.0013327 0.0013315 0.0303145 0.1741105
ts mo.1440 2018-05-01 1440 0.0018094 0.0018068 0.0636654 0.2523201
ts mo.1440 2018-05-02 1440 0.0006189 0.0006191 0.0066997 0.0818516
ts mo.1440 2018-05-03 1440 0.0031605 0.0031684 0.1900204 0.4359133
ts mo.1440 2018-05-04 1440 0.0008358 0.0008365 0.0152062 0.1233134
ts mo.1440 2018-05-05 1 0.0010685 0.0010691 0.0136127 0.1166735
ts mo.1440 2018-05-07 1439 0.0011199 0.0011192 0.0223430 0.1494757
ts mo.1440 2018-05-08 1440 0.0007801 0.0007804 0.0113551 0.1065603
ts mo.1440 2018-05-09 1440 0.0043041 0.0042934 0.2581366 0.5080715
ts mo.1440 2018-05-10 1440 0.0013982 0.0013996 0.0390151 0.1975224
ts mo.1440 2018-05-11 1440 0.0008709 0.0008713 0.0130281 0.1141405
ts mo.1440 2018-05-12 1 0.0001085 0.0001085 0.0001409 0.0118714
ts mo.1440 2018-05-14 1439 0.0009962 0.0009955 0.0193733 0.1391880
ts mo.1440 2018-05-15 1440 0.0030133 0.0030060 0.1755404 0.4189754
ts mo.1440 2018-05-16 1440 0.0011822 0.0011831 0.0246931 0.1571405
ts mo.1440 2018-05-17 1440 0.0020354 0.0020327 0.0716848 0.2677401
ts mo.1440 2018-05-18 1440 0.0011898 0.0011889 0.0243060 0.1559038
ts mo.1440 2018-05-19 1 0.0001146 0.0001146 0.0001611 0.0126927
ts mo.1440 2018-05-21 1439 0.0035841 0.0035769 0.1765591 0.4201893
ts mo.1440 2018-05-22 1440 0.0010873 0.0010880 0.0188758 0.1373891
ts mo.1440 2018-05-23 1440 0.0058119 0.0058348 0.5607743 0.7488486
ts mo.1440 2018-05-24 1440 0.0045846 0.0045977 0.3183663 0.5642395
ts mo.1440 2018-05-25 1440 0.0019628 0.0019602 0.0623572 0.2497142
ts mo.1440 2018-05-26 1 0.0012225 0.0012217 0.0178384 0.1335606
ts mo.1440 2018-05-28 1439 0.0007979 0.0007973 0.0176339 0.1327926
ts mo.1440 2018-05-29 1440 0.0045886 0.0046023 0.3276230 0.5723836
ts mo.1440 2018-05-30 1440 0.0014840 0.0014838 0.0348301 0.1866283
ts mo.1440 2018-05-31 1440 0.0013536 0.0013549 0.0300519 0.1733549
ts mo.1440 2018-06-01 1440 0.0044522 0.0044393 0.3051694 0.5524214
ts mo.1440 2018-06-02 1 0.0064289 0.0064083 0.4894299 0.6995927
ts mo.1440 2018-06-04 1439 0.0012318 0.0012308 0.0252241 0.1588209
ts mo.1440 2018-06-05 1440 0.0008194 0.0008192 0.0116460 0.1079165
ts mo.1440 2018-06-06 1440 0.0024113 0.0024076 0.0899958 0.2999931
ts mo.1440 2018-06-07 1440 0.0018578 0.0018603 0.0608297 0.2466369
ts mo.1440 2018-06-08 1440 0.0015519 0.0015535 0.0429898 0.2073398
ts mo.1440 2018-06-09 1 0.0015450 0.0015462 0.0287260 0.1694873
ts mo.1440 2018-06-11 1439 0.0033457 0.0033386 0.1726245 0.4154811
ts mo.1440 2018-06-12 1440 0.0022748 0.0022718 0.0723376 0.2689565
ts mo.1440 2018-06-13 1440 0.0013304 0.0013291 0.0305460 0.1747743
ts mo.1440 2018-06-14 1440 0.0020597 0.0020616 0.0691778 0.2630167
ts mo.1440 2018-06-15 1440 0.0006625 0.0006624 0.0085965 0.0927175
ts mo.1440 2018-06-16 1 0.0002951 0.0002951 0.0010659 0.0326477
ts mo.1440 2018-06-18 1439 0.0013553 0.0013564 0.0283325 0.1683226
ts mo.1440 2018-06-19 1440 0.0050872 0.0051024 0.3699783 0.6082584
ts mo.1440 2018-06-20 1440 0.0016517 0.0016501 0.0409453 0.2023495
ts mo.1440 2018-06-21 1440 0.0023278 0.0023273 0.0843295 0.2903954
ts mo.1440 2018-06-22 1440 0.0009163 0.0009156 0.0177474 0.1332193
ts mo.1440 2018-06-23 1 0.0000079 0.0000079 0.0000008 0.0008723
ts mo.1440 2018-06-25 1439 0.0031281 0.0031339 0.1395862 0.3736124
ts mo.1440 2018-06-26 1440 0.0014607 0.0014593 0.0474114 0.2177416
ts mo.1440 2018-06-27 1440 0.0015857 0.0015837 0.0547408 0.2339676
ts mo.1440 2018-06-28 1440 0.0011801 0.0011791 0.0260615 0.1614359
ts mo.1440 2018-06-29 1440 0.0022965 0.0022933 0.0792058 0.2814353
ts mo.1440 2018-06-30 1 0.0017275 0.0017260 0.0364372 0.1908852
ts mo.1440 2018-07-02 1439 0.0015545 0.0015528 0.0414666 0.2036334
ts mo.1440 2018-07-03 1440 0.0014015 0.0014023 0.0366551 0.1914552
ts mo.1440 2018-07-04 1440 0.0006953 0.0006956 0.0086726 0.0931270
ts mo.1440 2018-07-05 1440 0.0011078 0.0011071 0.0201046 0.1417905
ts mo.1440 2018-07-06 1440 0.0009011 0.0009013 0.0152419 0.1234581
ts mo.1440 2018-07-07 1 0.0016363 0.0016377 0.0327801 0.1810527
ts qt.1440 2018-01-03 1439 0.0006831 0.0006827 0.0103892 0.1019273
ts qt.1440 2018-01-04 1440 0.0016768 0.0016751 0.0422922 0.2056507
ts qt.1440 2018-01-05 1440 0.0024953 0.0024911 0.1075626 0.3279673
ts qt.1440 2018-01-06 1 0.0028290 0.0028250 0.1017282 0.3189485
ts qt.1440 2018-01-08 1439 0.0007281 0.0007278 0.0102252 0.1011197
ts qt.1440 2018-01-09 1440 0.0032367 0.0032432 0.1659303 0.4073454
ts qt.1440 2018-01-10 1440 0.0066417 0.0066724 0.7752016 0.8804553
ts qt.1440 2018-01-11 1440 0.0021202 0.0021179 0.0781641 0.2795785
ts qt.1440 2018-01-12 1440 0.0009403 0.0009404 0.0190289 0.1379453
ts qt.1440 2018-01-13 1 0.0020847 0.0020868 0.0537916 0.2319301
ts qt.1440 2018-01-15 1439 0.0031809 0.0031868 0.1450410 0.3808425
ts qt.1440 2018-01-16 1440 0.0019996 0.0019972 0.0620792 0.2491570
ts qt.1440 2018-01-17 1440 0.0026310 0.0026264 0.1194394 0.3456001
ts qt.1440 2018-01-18 1440 0.0011188 0.0011199 0.0305960 0.1749171
ts qt.1440 2018-01-19 1440 0.0032123 0.0032183 0.1489569 0.3859493
ts qt.1440 2018-01-20 1 0.0025519 0.0025552 0.0804111 0.2835686
ts qt.1440 2018-01-22 1439 0.0010994 0.0010986 0.0293561 0.1713361
ts qt.1440 2018-01-23 1440 0.0024651 0.0024695 0.1109970 0.3331621
ts qt.1440 2018-01-24 1440 0.0056911 0.0057129 0.5287370 0.7271430
ts qt.1440 2018-01-25 1440 0.0017953 0.0017970 0.0598675 0.2446783
ts qt.1440 2018-01-26 1440 0.0029656 0.0029718 0.1737378 0.4168187
ts qt.1440 2018-01-27 1 0.0071425 0.0071681 0.6106901 0.7814666
ts qt.1440 2018-01-29 1439 0.0026347 0.0026295 0.1237891 0.3518367
ts qt.1440 2018-01-30 1440 0.0014906 0.0014921 0.0365624 0.1912130
ts qt.1440 2018-01-31 1440 0.0020757 0.0020715 0.1017849 0.3190375
ts qt.1440 2018-02-01 1440 0.0027232 0.0027180 0.1250555 0.3536319
ts qt.1440 2018-02-02 1440 0.0045560 0.0045407 0.3707291 0.6088753
ts qt.1440 2018-02-03 1 0.0070387 0.0070140 0.5929877 0.7700569
ts qt.1440 2018-02-05 1439 0.0027180 0.0027234 0.1321203 0.3634836
ts qt.1440 2018-02-06 1440 0.0019259 0.0019271 0.0753219 0.2744484
ts qt.1440 2018-02-07 1440 0.0021554 0.0021585 0.0781449 0.2795440
ts qt.1440 2018-02-08 1440 0.0027445 0.0027458 0.1333561 0.3651796
ts qt.1440 2018-02-09 1440 0.0020198 0.0020201 0.0730994 0.2703689
ts qt.1440 2018-02-10 1 0.0003959 0.0003958 0.0018538 0.0430559
ts qt.1440 2018-02-12 1439 0.0015377 0.0015393 0.0393168 0.1982848
ts qt.1440 2018-02-13 1440 0.0066809 0.0067123 0.7424763 0.8616707
ts qt.1440 2018-02-14 1440 0.0047388 0.0047535 0.3413591 0.5842595
ts qt.1440 2018-02-15 1440 0.0045036 0.0045157 0.2748755 0.5242857
ts qt.1440 2018-02-16 1440 0.0011753 0.0011759 0.0262257 0.1619436
ts qt.1440 2018-02-17 1 0.0015951 0.0015938 0.0286611 0.1692959
ts qt.1440 2018-02-19 1439 0.0023207 0.0023174 0.0766354 0.2768310
ts qt.1440 2018-02-20 1440 0.0043341 0.0043225 0.2629109 0.5127484
ts qt.1440 2018-02-21 1440 0.0028600 0.0028546 0.1260915 0.3550936
ts qt.1440 2018-02-22 1440 0.0051588 0.0051765 0.4085832 0.6392052
ts qt.1440 2018-02-23 1440 0.0012486 0.0012475 0.0282839 0.1681783
ts qt.1440 2018-02-24 1 0.0013486 0.0013477 0.0207232 0.1439556
ts qt.1440 2018-02-26 1439 0.0017962 0.0017975 0.0481598 0.2194533
ts qt.1440 2018-02-27 1440 0.0020190 0.0020153 0.0862876 0.2937475
ts qt.1440 2018-02-28 1440 0.0024428 0.0024477 0.1143788 0.3381993
ts qt.1440 2018-03-01 1440 0.0016694 0.0016688 0.0470863 0.2169937
ts qt.1440 2018-03-02 1440 0.0048135 0.0048289 0.3465835 0.5887135
ts qt.1440 2018-03-03 1 0.0047281 0.0047393 0.2522601 0.5022550
ts qt.1440 2018-03-05 1439 0.0018079 0.0018064 0.0610287 0.2470398
ts qt.1440 2018-03-06 1440 0.0011802 0.0011799 0.0240594 0.1551111
ts qt.1440 2018-03-07 1440 0.0029359 0.0029414 0.1242007 0.3524212
ts qt.1440 2018-03-08 1440 0.0011596 0.0011587 0.0194579 0.1394915
ts qt.1440 2018-03-09 1440 0.0054740 0.0054578 0.3673783 0.6061174
ts qt.1440 2018-03-10 1 0.0056414 0.0056256 0.3591417 0.5992843
ts qt.1440 2018-03-12 1439 0.0021504 0.0021533 0.0692104 0.2630786
ts qt.1440 2018-03-13 1440 0.0033488 0.0033398 0.2051598 0.4529457
ts qt.1440 2018-03-14 1440 0.0014264 0.0014280 0.0381977 0.1954424
ts qt.1440 2018-03-15 1440 0.0023530 0.0023566 0.0815178 0.2855131
ts qt.1440 2018-03-16 1440 0.0029371 0.0029431 0.1353705 0.3679273
ts qt.1440 2018-03-17 1 0.0033786 0.0033843 0.1290836 0.3592821
ts qt.1440 2018-03-19 1439 0.0009708 0.0009703 0.0165321 0.1285770
ts qt.1440 2018-03-20 1440 0.0026792 0.0026749 0.0979600 0.3129856
ts qt.1440 2018-03-21 1440 0.0015870 0.0015892 0.0515675 0.2270849
ts qt.1440 2018-03-22 1440 0.0032348 0.0032418 0.1569086 0.3961169
ts qt.1440 2018-03-23 1440 0.0029583 0.0029635 0.1140694 0.3377416
ts qt.1440 2018-03-24 1 0.0051911 0.0052046 0.2986992 0.5465338
ts qt.1440 2018-03-26 1439 0.0032757 0.0032693 0.1397978 0.3738954
ts qt.1440 2018-03-27 1440 0.0024380 0.0024344 0.0789630 0.2810036
ts qt.1440 2018-03-28 1440 0.0053941 0.0053695 0.5490869 0.7410040
ts qt.1440 2018-03-29 1440 0.0026066 0.0026112 0.1092411 0.3305164
ts qt.1440 2018-03-30 1440 0.0016551 0.0016567 0.0378098 0.1944474
ts qt.1440 2018-03-31 1 0.0013389 0.0013398 0.0203055 0.1424974
ts qt.1440 2018-04-02 1439 0.0015211 0.0015227 0.0508442 0.2254867
ts qt.1440 2018-04-03 1440 0.0027526 0.0027466 0.1383391 0.3719397
ts qt.1440 2018-04-04 1440 0.0015243 0.0015264 0.0539729 0.2323207
ts qt.1440 2018-04-05 1440 0.0034731 0.0034652 0.1820592 0.4266840
ts qt.1440 2018-04-06 1440 0.0017730 0.0017755 0.0624358 0.2498715
ts qt.1440 2018-04-07 1 0.0041457 0.0041543 0.1981815 0.4451759
ts qt.1440 2018-04-09 1439 0.0012110 0.0012103 0.0239577 0.1547826
ts qt.1440 2018-04-10 1440 0.0027181 0.0027134 0.1072497 0.3274900
ts qt.1440 2018-04-11 1440 0.0020791 0.0020822 0.0706898 0.2658756
ts qt.1440 2018-04-12 1440 0.0023507 0.0023463 0.0995743 0.3155540
ts qt.1440 2018-04-13 1440 0.0014677 0.0014659 0.0412591 0.2031234
ts qt.1440 2018-04-14 1 0.0003358 0.0003358 0.0012990 0.0360413
ts qt.1440 2018-04-16 1439 0.0016847 0.0016859 0.0369616 0.1922539
ts qt.1440 2018-04-17 1440 0.0008862 0.0008867 0.0128452 0.1133366
ts qt.1440 2018-04-18 1440 0.0018063 0.0018042 0.0461544 0.2148357
ts qt.1440 2018-04-19 1440 0.0008810 0.0008805 0.0120259 0.1096626
ts qt.1440 2018-04-20 1440 0.0015958 0.0015943 0.0358618 0.1893721
ts qt.1440 2018-04-21 1 0.0025518 0.0025485 0.0750637 0.2739776
ts qt.1440 2018-04-23 1439 0.0040242 0.0040104 0.3202261 0.5658852
ts qt.1440 2018-04-24 1440 0.0008573 0.0008566 0.0187051 0.1367666
ts qt.1440 2018-04-25 1440 0.0023128 0.0023087 0.0965874 0.3107851
ts qt.1440 2018-04-26 1440 0.0013042 0.0013054 0.0297782 0.1725637
ts qt.1440 2018-04-27 1440 0.0009763 0.0009771 0.0201485 0.1419454
ts qt.1440 2018-04-28 1 0.0022240 0.0022264 0.0590888 0.2430820
ts qt.1440 2018-04-30 1439 0.0013332 0.0013319 0.0303382 0.1741787
ts qt.1440 2018-05-01 1440 0.0018102 0.0018076 0.0637036 0.2523958
ts qt.1440 2018-05-02 1440 0.0006186 0.0006188 0.0066917 0.0818030
ts qt.1440 2018-05-03 1440 0.0031580 0.0031659 0.1898010 0.4356616
ts qt.1440 2018-05-04 1440 0.0008363 0.0008369 0.0152108 0.1233322
ts qt.1440 2018-05-05 1 0.0010678 0.0010684 0.0135958 0.1166010
ts qt.1440 2018-05-07 1439 0.0011202 0.0011195 0.0223646 0.1495479
ts qt.1440 2018-05-08 1440 0.0007796 0.0007799 0.0113373 0.1064767
ts qt.1440 2018-05-09 1440 0.0043049 0.0042941 0.2582442 0.5081774
ts qt.1440 2018-05-10 1440 0.0013983 0.0013997 0.0390225 0.1975412
ts qt.1440 2018-05-11 1440 0.0008717 0.0008721 0.0130537 0.1142527
ts qt.1440 2018-05-12 1 0.0001088 0.0001088 0.0001417 0.0119035
ts qt.1440 2018-05-14 1439 0.0009968 0.0009961 0.0194027 0.1392938
ts qt.1440 2018-05-15 1440 0.0030141 0.0030068 0.1756007 0.4190473
ts qt.1440 2018-05-16 1440 0.0011822 0.0011832 0.0246951 0.1571468
ts qt.1440 2018-05-17 1440 0.0020354 0.0020327 0.0716861 0.2677427
ts qt.1440 2018-05-18 1440 0.0011901 0.0011892 0.0243190 0.1559454
ts qt.1440 2018-05-19 1 0.0001146 0.0001146 0.0001610 0.0126887
ts qt.1440 2018-05-21 1439 0.0035854 0.0035782 0.1766676 0.4203184
ts qt.1440 2018-05-22 1440 0.0010846 0.0010854 0.0187991 0.1371098
ts qt.1440 2018-05-23 1440 0.0058113 0.0058342 0.5606810 0.7487864
ts qt.1440 2018-05-24 1440 0.0045846 0.0045977 0.3183715 0.5642442
ts qt.1440 2018-05-25 1440 0.0019627 0.0019601 0.0623463 0.2496923
ts qt.1440 2018-05-26 1 0.0012226 0.0012218 0.0178420 0.1335741
ts qt.1440 2018-05-28 1439 0.0007979 0.0007972 0.0176343 0.1327940
ts qt.1440 2018-05-29 1440 0.0045874 0.0046011 0.3274845 0.5722627
ts qt.1440 2018-05-30 1440 0.0014836 0.0014834 0.0348119 0.1865794
ts qt.1440 2018-05-31 1440 0.0013501 0.0013513 0.0299007 0.1729181
ts qt.1440 2018-06-01 1440 0.0044538 0.0044410 0.3054200 0.5526482
ts qt.1440 2018-06-02 1 0.0064294 0.0064088 0.4895045 0.6996460
ts qt.1440 2018-06-04 1439 0.0012305 0.0012295 0.0251724 0.1586582
ts qt.1440 2018-06-05 1440 0.0008179 0.0008177 0.0116054 0.1077286
ts qt.1440 2018-06-06 1440 0.0024067 0.0024030 0.0897148 0.2995243
ts qt.1440 2018-06-07 1440 0.0018591 0.0018616 0.0608853 0.2467495
ts qt.1440 2018-06-08 1440 0.0015534 0.0015551 0.0430697 0.2075325
ts qt.1440 2018-06-09 1 0.0015449 0.0015461 0.0287242 0.1694823
ts qt.1440 2018-06-11 1439 0.0033475 0.0033404 0.1728102 0.4157044
ts qt.1440 2018-06-12 1440 0.0022798 0.0022768 0.0726214 0.2694836
ts qt.1440 2018-06-13 1440 0.0013311 0.0013299 0.0305674 0.1748354
ts qt.1440 2018-06-14 1440 0.0020601 0.0020620 0.0692138 0.2630851
ts qt.1440 2018-06-15 1440 0.0006629 0.0006627 0.0086089 0.0927842
ts qt.1440 2018-06-16 1 0.0002957 0.0002957 0.0010703 0.0327148
ts qt.1440 2018-06-18 1439 0.0013555 0.0013567 0.0283448 0.1683592
ts qt.1440 2018-06-19 1440 0.0050862 0.0051014 0.3698625 0.6081632
ts qt.1440 2018-06-20 1440 0.0016523 0.0016506 0.0409649 0.2023979
ts qt.1440 2018-06-21 1440 0.0023278 0.0023273 0.0843434 0.2904193
ts qt.1440 2018-06-22 1440 0.0009162 0.0009156 0.0177225 0.1331258
ts qt.1440 2018-06-23 1 0.0000088 0.0000088 0.0000009 0.0009659
ts qt.1440 2018-06-25 1439 0.0031263 0.0031321 0.1394299 0.3734031
ts qt.1440 2018-06-26 1440 0.0014616 0.0014602 0.0474650 0.2178647
ts qt.1440 2018-06-27 1440 0.0015873 0.0015853 0.0548285 0.2341548
ts qt.1440 2018-06-28 1440 0.0011830 0.0011820 0.0261578 0.1617337
ts qt.1440 2018-06-29 1440 0.0022958 0.0022926 0.0791540 0.2813432
ts qt.1440 2018-06-30 1 0.0017277 0.0017262 0.0364452 0.1909063
ts qt.1440 2018-07-02 1439 0.0015529 0.0015512 0.0413942 0.2034557
ts qt.1440 2018-07-03 1440 0.0014015 0.0014022 0.0366592 0.1914659
ts qt.1440 2018-07-04 1440 0.0006939 0.0006943 0.0086466 0.0929872
ts qt.1440 2018-07-05 1440 0.0011100 0.0011093 0.0201886 0.1420867
ts qt.1440 2018-07-06 1440 0.0009011 0.0009014 0.0151943 0.1232651
ts qt.1440 2018-07-07 1 0.0016328 0.0016341 0.0326368 0.1806567
ts wk.1440 2018-01-03 1439 0.0006377 0.0006374 0.0093590 0.0967421
ts wk.1440 2018-01-04 1440 0.0015429 0.0015414 0.0365370 0.1911465
ts wk.1440 2018-01-05 1440 0.0024296 0.0024257 0.1005683 0.3171250
ts wk.1440 2018-01-06 1 0.0027088 0.0027051 0.0932913 0.3054363
ts wk.1440 2018-01-08 1439 0.0007430 0.0007427 0.0116784 0.1080667
ts wk.1440 2018-01-09 1440 0.0034737 0.0034810 0.1879770 0.4335632
ts wk.1440 2018-01-10 1440 0.0068096 0.0068410 0.7921221 0.8900124
ts wk.1440 2018-01-11 1440 0.0022222 0.0022198 0.0813264 0.2851778
ts wk.1440 2018-01-12 1440 0.0010002 0.0010003 0.0205997 0.1435259
ts wk.1440 2018-01-13 1 0.0020481 0.0020502 0.0519180 0.2278553
ts wk.1440 2018-01-15 1439 0.0033845 0.0033910 0.1606568 0.4008201
ts wk.1440 2018-01-16 1440 0.0038929 0.0038844 0.2090785 0.4572511
ts wk.1440 2018-01-17 1440 0.0021212 0.0021181 0.0928568 0.3047242
ts wk.1440 2018-01-18 1440 0.0013063 0.0013076 0.0382794 0.1956513
ts wk.1440 2018-01-19 1440 0.0031640 0.0031700 0.1464485 0.3826859
ts wk.1440 2018-01-20 1 0.0024653 0.0024684 0.0750321 0.2739199
ts wk.1440 2018-01-22 1439 0.0012033 0.0012022 0.0367588 0.1917259
ts wk.1440 2018-01-23 1440 0.0023469 0.0023505 0.0954409 0.3089351
ts wk.1440 2018-01-24 1440 0.0053082 0.0053277 0.4719133 0.6869595
ts wk.1440 2018-01-25 1440 0.0015920 0.0015935 0.0514737 0.2268782
ts wk.1440 2018-01-26 1440 0.0028989 0.0029047 0.1639420 0.4048975
ts wk.1440 2018-01-27 1 0.0071927 0.0072187 0.6193685 0.7869997
ts wk.1440 2018-01-29 1439 0.0025037 0.0024987 0.1234091 0.3512963
ts wk.1440 2018-01-30 1440 0.0019092 0.0019114 0.0563017 0.2372798
ts wk.1440 2018-01-31 1440 0.0020460 0.0020419 0.1019659 0.3193210
ts wk.1440 2018-02-01 1440 0.0026329 0.0026280 0.1186766 0.3444947
ts wk.1440 2018-02-02 1440 0.0041788 0.0041658 0.3134566 0.5598719
ts wk.1440 2018-02-03 1 0.0071070 0.0070818 0.6044744 0.7774795
ts wk.1440 2018-02-05 1439 0.0028535 0.0028594 0.1418618 0.3766454
ts wk.1440 2018-02-06 1440 0.0019690 0.0019706 0.0768099 0.2771461
ts wk.1440 2018-02-07 1440 0.0023334 0.0023370 0.0921589 0.3035769
ts wk.1440 2018-02-08 1440 0.0030423 0.0030433 0.1522833 0.3902349
ts wk.1440 2018-02-09 1440 0.0021768 0.0021772 0.0792454 0.2815057
ts wk.1440 2018-02-10 1 0.0004803 0.0004802 0.0027276 0.0522260
ts wk.1440 2018-02-12 1439 0.0017020 0.0017041 0.0513134 0.2265246
ts wk.1440 2018-02-13 1440 0.0064973 0.0065272 0.7033481 0.8386585
ts wk.1440 2018-02-14 1440 0.0046830 0.0046971 0.3265691 0.5714622
ts wk.1440 2018-02-15 1440 0.0044289 0.0044405 0.2648426 0.5146286
ts wk.1440 2018-02-16 1440 0.0013118 0.0013117 0.0283733 0.1684438
ts wk.1440 2018-02-17 1 0.0016105 0.0016092 0.0292167 0.1709288
ts wk.1440 2018-02-19 1439 0.0028652 0.0028601 0.1188276 0.3447138
ts wk.1440 2018-02-20 1440 0.0043710 0.0043593 0.2672058 0.5169196
ts wk.1440 2018-02-21 1440 0.0026410 0.0026358 0.1206757 0.3473841
ts wk.1440 2018-02-22 1440 0.0054411 0.0054605 0.4496075 0.6705278
ts wk.1440 2018-02-23 1440 0.0010505 0.0010499 0.0189255 0.1375698
ts wk.1440 2018-02-24 1 0.0012833 0.0012825 0.0187693 0.1370010
ts wk.1440 2018-02-26 1439 0.0021052 0.0021071 0.0690037 0.2626856
ts wk.1440 2018-02-27 1440 0.0021804 0.0021763 0.0961102 0.3100165
ts wk.1440 2018-02-28 1440 0.0024000 0.0024050 0.1150795 0.3392337
ts wk.1440 2018-03-01 1440 0.0016842 0.0016839 0.0462265 0.2150035
ts wk.1440 2018-03-02 1440 0.0051332 0.0051505 0.3896439 0.6242147
ts wk.1440 2018-03-03 1 0.0047451 0.0047564 0.2540904 0.5040738
ts wk.1440 2018-03-05 1439 0.0015891 0.0015877 0.0514395 0.2268027
ts wk.1440 2018-03-06 1440 0.0013126 0.0013123 0.0280608 0.1675135
ts wk.1440 2018-03-07 1440 0.0030734 0.0030794 0.1349351 0.3673351
ts wk.1440 2018-03-08 1440 0.0016855 0.0016838 0.0379365 0.1947730
ts wk.1440 2018-03-09 1440 0.0061676 0.0061470 0.4652995 0.6821286
ts wk.1440 2018-03-10 1 0.0057299 0.0057136 0.3704323 0.6086315
ts wk.1440 2018-03-12 1439 0.0020176 0.0020203 0.0628140 0.2506272
ts wk.1440 2018-03-13 1440 0.0033350 0.0033267 0.1935115 0.4398994
ts wk.1440 2018-03-14 1440 0.0020142 0.0020168 0.0584872 0.2418413
ts wk.1440 2018-03-15 1440 0.0029342 0.0029399 0.1304239 0.3611425
ts wk.1440 2018-03-16 1440 0.0030449 0.0030515 0.1517832 0.3895936
ts wk.1440 2018-03-17 1 0.0033993 0.0034051 0.1306823 0.3615000
ts wk.1440 2018-03-19 1439 0.0009585 0.0009582 0.0168920 0.1299693
ts wk.1440 2018-03-20 1440 0.0030837 0.0030779 0.1289772 0.3591340
ts wk.1440 2018-03-21 1440 0.0013897 0.0013913 0.0415519 0.2038428
ts wk.1440 2018-03-22 1440 0.0030439 0.0030502 0.1406609 0.3750479
ts wk.1440 2018-03-23 1440 0.0032527 0.0032589 0.1361459 0.3689795
ts wk.1440 2018-03-24 1 0.0051860 0.0051995 0.2981044 0.5459894
ts wk.1440 2018-03-26 1439 0.0029438 0.0029386 0.1147257 0.3387119
ts wk.1440 2018-03-27 1440 0.0022064 0.0022034 0.0655104 0.2559499
ts wk.1440 2018-03-28 1440 0.0045837 0.0045633 0.4556683 0.6750321
ts wk.1440 2018-03-29 1440 0.0027442 0.0027492 0.1195169 0.3457122
ts wk.1440 2018-03-30 1440 0.0016119 0.0016134 0.0364448 0.1909051
ts wk.1440 2018-03-31 1 0.0013532 0.0013541 0.0207428 0.1440237
ts wk.1440 2018-04-02 1439 0.0017560 0.0017569 0.0529399 0.2300868
ts wk.1440 2018-04-03 1440 0.0029711 0.0029644 0.1556651 0.3945441
ts wk.1440 2018-04-04 1440 0.0014267 0.0014281 0.0418298 0.2045232
ts wk.1440 2018-04-05 1440 0.0036514 0.0036426 0.2012721 0.4486336
ts wk.1440 2018-04-06 1440 0.0017782 0.0017806 0.0612359 0.2474589
ts wk.1440 2018-04-07 1 0.0041445 0.0041532 0.1980730 0.4450539
ts wk.1440 2018-04-09 1439 0.0012175 0.0012169 0.0232286 0.1524094
ts wk.1440 2018-04-10 1440 0.0026957 0.0026912 0.1033647 0.3215037
ts wk.1440 2018-04-11 1440 0.0023617 0.0023654 0.0863748 0.2938960
ts wk.1440 2018-04-12 1440 0.0020443 0.0020406 0.0837986 0.2894799
ts wk.1440 2018-04-13 1440 0.0011664 0.0011652 0.0263757 0.1624061
ts wk.1440 2018-04-14 1 0.0003228 0.0003228 0.0012002 0.0346437
ts wk.1440 2018-04-16 1439 0.0018894 0.0018910 0.0464018 0.2154108
ts wk.1440 2018-04-17 1440 0.0008097 0.0008102 0.0106438 0.1031689
ts wk.1440 2018-04-18 1440 0.0018186 0.0018165 0.0497680 0.2230875
ts wk.1440 2018-04-19 1440 0.0008881 0.0008876 0.0120401 0.1097273
ts wk.1440 2018-04-20 1440 0.0014749 0.0014735 0.0321726 0.1793671
ts wk.1440 2018-04-21 1 0.0025507 0.0025474 0.0750001 0.2738615
ts wk.1440 2018-04-23 1439 0.0039410 0.0039272 0.3221683 0.5675987
ts wk.1440 2018-04-24 1440 0.0026305 0.0026357 0.1272682 0.3567467
ts wk.1440 2018-04-25 1440 0.0009388 0.0009382 0.0165561 0.1286705
ts wk.1440 2018-04-26 1440 0.0032163 0.0032232 0.1669224 0.4085613
ts wk.1440 2018-04-27 1440 0.0010050 0.0010055 0.0190342 0.1379645
ts wk.1440 2018-04-28 1 0.0022235 0.0022260 0.0590657 0.2430344
ts wk.1440 2018-04-30 1439 0.0016206 0.0016189 0.0404867 0.2012132
ts wk.1440 2018-05-01 1440 0.0018381 0.0018354 0.0667639 0.2583872
ts wk.1440 2018-05-02 1440 0.0005955 0.0005955 0.0058934 0.0767684
ts wk.1440 2018-05-03 1440 0.0031220 0.0031297 0.1873461 0.4328349
ts wk.1440 2018-05-04 1440 0.0008457 0.0008463 0.0155368 0.1246468
ts wk.1440 2018-05-05 1 0.0010686 0.0010692 0.0136154 0.1166849
ts wk.1440 2018-05-07 1439 0.0012400 0.0012390 0.0274047 0.1655437
ts wk.1440 2018-05-08 1440 0.0008154 0.0008157 0.0122286 0.1105829
ts wk.1440 2018-05-09 1440 0.0042896 0.0042790 0.2543471 0.5043284
ts wk.1440 2018-05-10 1440 0.0015154 0.0015171 0.0451042 0.2123774
ts wk.1440 2018-05-11 1440 0.0010083 0.0010090 0.0184580 0.1358603
ts wk.1440 2018-05-12 1 0.0001095 0.0001095 0.0001434 0.0119770
ts wk.1440 2018-05-14 1439 0.0009805 0.0009799 0.0189849 0.1377855
ts wk.1440 2018-05-15 1440 0.0029573 0.0029500 0.1769324 0.4206334
ts wk.1440 2018-05-16 1440 0.0011120 0.0011129 0.0215632 0.1468440
ts wk.1440 2018-05-17 1440 0.0022316 0.0022281 0.0887804 0.2979604
ts wk.1440 2018-05-18 1440 0.0015236 0.0015220 0.0400530 0.2001325
ts wk.1440 2018-05-19 1 0.0001146 0.0001146 0.0001611 0.0126929
ts wk.1440 2018-05-21 1439 0.0037959 0.0037878 0.1992589 0.4463843
ts wk.1440 2018-05-22 1440 0.0012439 0.0012449 0.0245710 0.1567513
ts wk.1440 2018-05-23 1440 0.0060539 0.0060785 0.6027881 0.7763943
ts wk.1440 2018-05-24 1440 0.0046682 0.0046817 0.3281552 0.5728483
ts wk.1440 2018-05-25 1440 0.0019685 0.0019659 0.0621719 0.2493430
ts wk.1440 2018-05-26 1 0.0012220 0.0012213 0.0178259 0.1335135
ts wk.1440 2018-05-28 1439 0.0008636 0.0008628 0.0196285 0.1401017
ts wk.1440 2018-05-29 1440 0.0045162 0.0045295 0.3155873 0.5617716
ts wk.1440 2018-05-30 1440 0.0017530 0.0017527 0.0479193 0.2189048
ts wk.1440 2018-05-31 1440 0.0015136 0.0015151 0.0356393 0.1887837
ts wk.1440 2018-06-01 1440 0.0046222 0.0046085 0.3254560 0.5704875
ts wk.1440 2018-06-02 1 0.0064294 0.0064088 0.4895020 0.6996442
ts wk.1440 2018-06-04 1439 0.0014075 0.0014062 0.0326237 0.1806204
ts wk.1440 2018-06-05 1440 0.0009757 0.0009754 0.0164131 0.1281135
ts wk.1440 2018-06-06 1440 0.0023960 0.0023925 0.0853821 0.2922022
ts wk.1440 2018-06-07 1440 0.0020312 0.0020341 0.0696411 0.2638960
ts wk.1440 2018-06-08 1440 0.0015560 0.0015578 0.0447179 0.2114662
ts wk.1440 2018-06-09 1 0.0015441 0.0015453 0.0286927 0.1693892
ts wk.1440 2018-06-11 1439 0.0034839 0.0034765 0.1822737 0.4269352
ts wk.1440 2018-06-12 1440 0.0020918 0.0020893 0.0621825 0.2493641
ts wk.1440 2018-06-13 1440 0.0012377 0.0012366 0.0270009 0.1643196
ts wk.1440 2018-06-14 1440 0.0022918 0.0022947 0.0869863 0.2949344
ts wk.1440 2018-06-15 1440 0.0007416 0.0007414 0.0109773 0.1047727
ts wk.1440 2018-06-16 1 0.0002949 0.0002948 0.0010641 0.0326204
ts wk.1440 2018-06-18 1439 0.0012722 0.0012732 0.0261586 0.1617362
ts wk.1440 2018-06-19 1440 0.0047863 0.0047996 0.3251664 0.5702337
ts wk.1440 2018-06-20 1440 0.0024198 0.0024165 0.0794441 0.2818583
ts wk.1440 2018-06-21 1440 0.0026895 0.0026874 0.1111407 0.3333777
ts wk.1440 2018-06-22 1440 0.0009687 0.0009681 0.0174531 0.1321104
ts wk.1440 2018-06-23 1 0.0000103 0.0000103 0.0000013 0.0011338
ts wk.1440 2018-06-25 1439 0.0033070 0.0033133 0.1539469 0.3923607
ts wk.1440 2018-06-26 1440 0.0015940 0.0015926 0.0536322 0.2315862
ts wk.1440 2018-06-27 1440 0.0016759 0.0016741 0.0551545 0.2348499
ts wk.1440 2018-06-28 1440 0.0012185 0.0012175 0.0273435 0.1653586
ts wk.1440 2018-06-29 1440 0.0026798 0.0026757 0.1016952 0.3188969
ts wk.1440 2018-06-30 1 0.0017275 0.0017260 0.0364363 0.1908830
ts wk.1440 2018-07-02 1439 0.0016023 0.0016004 0.0462015 0.2149454
ts wk.1440 2018-07-03 1440 0.0015382 0.0015392 0.0459171 0.2142827
ts wk.1440 2018-07-04 1440 0.0010481 0.0010488 0.0180869 0.1344874
ts wk.1440 2018-07-05 1440 0.0010587 0.0010582 0.0168149 0.1296722
ts wk.1440 2018-07-06 1440 0.0008894 0.0008899 0.0144213 0.1200889
ts wk.1440 2018-07-07 1 0.0016397 0.0016410 0.0329140 0.1814223
ts wk.7200 2018-01-03 7195 0.0031414 0.0031467 0.1318562 0.3631201
ts wk.7200 2018-01-04 7200 0.0007263 0.0007263 0.0088109 0.0938664
ts wk.7200 2018-01-05 7200 0.0033109 0.0033042 0.1712639 0.4138404
ts wk.7200 2018-01-06 5 0.0033901 0.0033844 0.1459240 0.3820000
ts wk.7200 2018-01-08 7195 0.0039391 0.0039311 0.2050746 0.4528517
ts wk.7200 2018-01-09 7200 0.0040211 0.0040307 0.2464068 0.4963938
ts wk.7200 2018-01-10 7200 0.0070906 0.0071240 0.8446258 0.9190353
ts wk.7200 2018-01-11 7200 0.0016810 0.0016802 0.0501111 0.2238550
ts wk.7200 2018-01-12 7200 0.0009459 0.0009462 0.0193830 0.1392229
ts wk.7200 2018-01-13 5 0.0020951 0.0020973 0.0543298 0.2330875
ts wk.7200 2018-01-15 7195 0.0032362 0.0032424 0.1531036 0.3912845
ts wk.7200 2018-01-16 7200 0.0018546 0.0018528 0.0537027 0.2317384
ts wk.7200 2018-01-17 7200 0.0026467 0.0026420 0.1168366 0.3418137
ts wk.7200 2018-01-18 7200 0.0012101 0.0012114 0.0359617 0.1896357
ts wk.7200 2018-01-19 7200 0.0030660 0.0030718 0.1439754 0.3794408
ts wk.7200 2018-01-20 5 0.0024655 0.0024686 0.0750439 0.2739413
ts wk.7200 2018-01-22 7195 0.0009303 0.0009301 0.0176592 0.1328879
ts wk.7200 2018-01-23 7200 0.0027056 0.0027112 0.1388723 0.3726558
ts wk.7200 2018-01-24 7200 0.0059676 0.0059923 0.6004224 0.7748693
ts wk.7200 2018-01-25 7200 0.0021473 0.0021505 0.0859483 0.2931694
ts wk.7200 2018-01-26 7200 0.0035808 0.0035912 0.2610875 0.5109672
ts wk.7200 2018-01-27 5 0.0071927 0.0072187 0.6193681 0.7869994
ts wk.7200 2018-01-29 7195 0.0020564 0.0020535 0.0690661 0.2628043
ts wk.7200 2018-01-30 7200 0.0017880 0.0017901 0.0518208 0.2276417
ts wk.7200 2018-01-31 7200 0.0015933 0.0015908 0.0616236 0.2482410
ts wk.7200 2018-02-01 7200 0.0021347 0.0021316 0.0759614 0.2756109
ts wk.7200 2018-02-02 7200 0.0043702 0.0043564 0.3327274 0.5768253
ts wk.7200 2018-02-03 5 0.0071064 0.0070813 0.6043809 0.7774194
ts wk.7200 2018-02-05 7195 0.0026141 0.0026193 0.1267205 0.3559782
ts wk.7200 2018-02-06 7200 0.0019374 0.0019371 0.0695778 0.2637761
ts wk.7200 2018-02-07 7200 0.0023371 0.0023408 0.0920698 0.3034301
ts wk.7200 2018-02-08 7200 0.0024018 0.0024023 0.1001011 0.3163876
ts wk.7200 2018-02-09 7200 0.0019889 0.0019878 0.0677661 0.2603193
ts wk.7200 2018-02-10 5 0.0004745 0.0004744 0.0026630 0.0516045
ts wk.7200 2018-02-12 7195 0.0011758 0.0011766 0.0200692 0.1416658
ts wk.7200 2018-02-13 7200 0.0061931 0.0062203 0.6398331 0.7998957
ts wk.7200 2018-02-14 7200 0.0049931 0.0050091 0.3708889 0.6090065
ts wk.7200 2018-02-15 7200 0.0047551 0.0047683 0.3013010 0.5489089
ts wk.7200 2018-02-16 7200 0.0013685 0.0013695 0.0367189 0.1916218
ts wk.7200 2018-02-17 5 0.0016104 0.0016091 0.0292141 0.1709214
ts wk.7200 2018-02-19 7195 0.0018805 0.0018784 0.0502624 0.2241928
ts wk.7200 2018-02-20 7200 0.0039183 0.0039084 0.2261113 0.4755116
ts wk.7200 2018-02-21 7200 0.0025421 0.0025380 0.0954939 0.3090209
ts wk.7200 2018-02-22 7200 0.0053752 0.0053940 0.4360534 0.6603434
ts wk.7200 2018-02-23 7200 0.0010670 0.0010664 0.0194058 0.1393048
ts wk.7200 2018-02-24 5 0.0012833 0.0012825 0.0187690 0.1370001
ts wk.7200 2018-02-26 7195 0.0017220 0.0017237 0.0488638 0.2210516
ts wk.7200 2018-02-27 7200 0.0017670 0.0017641 0.0695035 0.2636352
ts wk.7200 2018-02-28 7200 0.0028541 0.0028601 0.1382651 0.3718401
ts wk.7200 2018-03-01 7200 0.0014271 0.0014270 0.0407566 0.2018827
ts wk.7200 2018-03-02 7200 0.0044549 0.0044685 0.3069355 0.5540176
ts wk.7200 2018-03-03 5 0.0047465 0.0047578 0.2542408 0.5042230
ts wk.7200 2018-03-05 7195 0.0020813 0.0020805 0.0656674 0.2562564
ts wk.7200 2018-03-06 7200 0.0010509 0.0010512 0.0191604 0.1384211
ts wk.7200 2018-03-07 7200 0.0032838 0.0032906 0.1519187 0.3897674
ts wk.7200 2018-03-08 7200 0.0006008 0.0006007 0.0064412 0.0802574
ts wk.7200 2018-03-09 7200 0.0048046 0.0047919 0.2882735 0.5369110
ts wk.7200 2018-03-10 5 0.0057323 0.0057160 0.3707428 0.6088865
ts wk.7200 2018-03-12 7195 0.0023398 0.0023430 0.0759610 0.2756102
ts wk.7200 2018-03-13 7200 0.0028998 0.0028929 0.1571938 0.3964767
ts wk.7200 2018-03-14 7200 0.0013293 0.0013307 0.0331116 0.1819659
ts wk.7200 2018-03-15 7200 0.0023837 0.0023874 0.0828075 0.2877628
ts wk.7200 2018-03-16 7200 0.0033265 0.0033339 0.1664579 0.4079925
ts wk.7200 2018-03-17 5 0.0033993 0.0034051 0.1306823 0.3615000
ts wk.7200 2018-03-19 7195 0.0011848 0.0011850 0.0217902 0.1476151
ts wk.7200 2018-03-20 7200 0.0022842 0.0022809 0.0756470 0.2750400
ts wk.7200 2018-03-21 7200 0.0017213 0.0017238 0.0554275 0.2354305
ts wk.7200 2018-03-22 7200 0.0034457 0.0034532 0.1688587 0.4109242
ts wk.7200 2018-03-23 7200 0.0032288 0.0032349 0.1359440 0.3687058
ts wk.7200 2018-03-24 5 0.0051860 0.0051995 0.2981042 0.5459892
ts wk.7200 2018-03-26 7195 0.0028857 0.0028803 0.1198486 0.3461916
ts wk.7200 2018-03-27 7200 0.0019739 0.0019715 0.0548889 0.2342838
ts wk.7200 2018-03-28 7200 0.0054905 0.0054644 0.5832838 0.7637302
ts wk.7200 2018-03-29 7200 0.0026980 0.0027026 0.1069103 0.3269714
ts wk.7200 2018-03-30 7200 0.0017344 0.0017361 0.0397622 0.1994047
ts wk.7200 2018-03-31 5 0.0013530 0.0013539 0.0207364 0.1440013
ts wk.7200 2018-04-02 7195 0.0011295 0.0011310 0.0377658 0.1943343
ts wk.7200 2018-04-03 7200 0.0027909 0.0027843 0.1512558 0.3889162
ts wk.7200 2018-04-04 7200 0.0017285 0.0017308 0.0600590 0.2450693
ts wk.7200 2018-04-05 7200 0.0028601 0.0028538 0.1440498 0.3795390
ts wk.7200 2018-04-06 7200 0.0017681 0.0017708 0.0637109 0.2524102
ts wk.7200 2018-04-07 5 0.0041453 0.0041539 0.1981415 0.4451308
ts wk.7200 2018-04-09 7195 0.0009029 0.0009026 0.0139964 0.1183064
ts wk.7200 2018-04-10 7200 0.0026414 0.0026370 0.1022637 0.3197870
ts wk.7200 2018-04-11 7200 0.0020889 0.0020919 0.0689249 0.2625356
ts wk.7200 2018-04-12 7200 0.0022912 0.0022869 0.0980558 0.3131386
ts wk.7200 2018-04-13 7200 0.0015215 0.0015197 0.0421425 0.2052864
ts wk.7200 2018-04-14 5 0.0003216 0.0003215 0.0011909 0.0345098
ts wk.7200 2018-04-16 7195 0.0012819 0.0012826 0.0235916 0.1535956
ts wk.7200 2018-04-17 7200 0.0006962 0.0006965 0.0083396 0.0913214
ts wk.7200 2018-04-18 7200 0.0020413 0.0020389 0.0564488 0.2375895
ts wk.7200 2018-04-19 7200 0.0012612 0.0012603 0.0218598 0.1478506
ts wk.7200 2018-04-20 7200 0.0020460 0.0020435 0.0575700 0.2399375
ts wk.7200 2018-04-21 5 0.0025515 0.0025482 0.0750482 0.2739493
ts wk.7200 2018-04-23 7195 0.0045405 0.0045250 0.3622271 0.6018530
ts wk.7200 2018-04-24 7200 0.0011911 0.0011898 0.0309173 0.1758332
ts wk.7200 2018-04-25 7200 0.0061491 0.0061770 0.6819061 0.8257760
ts wk.7200 2018-04-26 7200 0.0120615 0.0121558 2.3133651 1.5209750
ts wk.7200 2018-04-27 7200 0.0008809 0.0008815 0.0183121 0.1353224
ts wk.7200 2018-04-28 5 0.0022232 0.0022257 0.0590493 0.2430007
ts wk.7200 2018-04-30 7195 0.0014982 0.0014966 0.0373042 0.1931430
ts wk.7200 2018-05-01 7200 0.0019000 0.0018972 0.0692565 0.2631662
ts wk.7200 2018-05-02 7200 0.0006549 0.0006552 0.0081629 0.0903490
ts wk.7200 2018-05-03 7200 0.0032227 0.0032306 0.1898766 0.4357484
ts wk.7200 2018-05-04 7200 0.0010356 0.0010365 0.0206772 0.1437958
ts wk.7200 2018-05-05 5 0.0010683 0.0010689 0.0136074 0.1166509
ts wk.7200 2018-05-07 7195 0.0010926 0.0010920 0.0213329 0.1460578
ts wk.7200 2018-05-08 7200 0.0008267 0.0008270 0.0120253 0.1096601
ts wk.7200 2018-05-09 7200 0.0041083 0.0040983 0.2381978 0.4880552
ts wk.7200 2018-05-10 7200 0.0013582 0.0013594 0.0377417 0.1942722
ts wk.7200 2018-05-11 7200 0.0007075 0.0007077 0.0085535 0.0924849
ts wk.7200 2018-05-12 5 0.0001095 0.0001095 0.0001436 0.0119818
ts wk.7200 2018-05-14 7195 0.0011009 0.0011002 0.0199433 0.1412207
ts wk.7200 2018-05-15 7200 0.0030283 0.0030211 0.1736171 0.4166739
ts wk.7200 2018-05-16 7200 0.0010725 0.0010733 0.0197746 0.1406220
ts wk.7200 2018-05-17 7200 0.0020266 0.0020244 0.0649055 0.2547655
ts wk.7200 2018-05-18 7200 0.0011067 0.0011061 0.0198144 0.1407637
ts wk.7200 2018-05-19 5 0.0001142 0.0001142 0.0001601 0.0126529
ts wk.7200 2018-05-21 7195 0.0034659 0.0034590 0.1709129 0.4134162
ts wk.7200 2018-05-22 7200 0.0008754 0.0008758 0.0118086 0.1086674
ts wk.7200 2018-05-23 7200 0.0057100 0.0057318 0.5327100 0.7298699
ts wk.7200 2018-05-24 7200 0.0049610 0.0049758 0.3572528 0.5977063
ts wk.7200 2018-05-25 7200 0.0016314 0.0016297 0.0431855 0.2078111
ts wk.7200 2018-05-26 5 0.0012219 0.0012212 0.0178230 0.1335027
ts wk.7200 2018-05-28 7195 0.0008202 0.0008195 0.0181591 0.1347557
ts wk.7200 2018-05-29 7200 0.0046705 0.0046847 0.3398942 0.5830045
ts wk.7200 2018-05-30 7200 0.0013343 0.0013346 0.0274149 0.1655743
ts wk.7200 2018-05-31 7200 0.0015399 0.0015416 0.0400234 0.2000584
ts wk.7200 2018-06-01 7200 0.0039110 0.0039006 0.2457693 0.4957513
ts wk.7200 2018-06-02 5 0.0064302 0.0064096 0.4896196 0.6997282
ts wk.7200 2018-06-04 7195 0.0009617 0.0009610 0.0173077 0.1315586
ts wk.7200 2018-06-05 7200 0.0006840 0.0006841 0.0090982 0.0953846
ts wk.7200 2018-06-06 7200 0.0020183 0.0020155 0.0663835 0.2576500
ts wk.7200 2018-06-07 7200 0.0020827 0.0020857 0.0739825 0.2719973
ts wk.7200 2018-06-08 7200 0.0016502 0.0016521 0.0493522 0.2221536
ts wk.7200 2018-06-09 5 0.0015453 0.0015465 0.0287397 0.1695279
ts wk.7200 2018-06-11 7195 0.0030990 0.0030933 0.1417896 0.3765496
ts wk.7200 2018-06-12 7200 0.0022481 0.0022453 0.0701022 0.2647683
ts wk.7200 2018-06-13 7200 0.0013500 0.0013487 0.0326133 0.1805914
ts wk.7200 2018-06-14 7200 0.0016997 0.0017008 0.0502138 0.2240844
ts wk.7200 2018-06-15 7200 0.0007272 0.0007272 0.0098713 0.0993543
ts wk.7200 2018-06-16 5 0.0002951 0.0002950 0.0010657 0.0326453
ts wk.7200 2018-06-18 7195 0.0014171 0.0014183 0.0292714 0.1710890
ts wk.7200 2018-06-19 7200 0.0052957 0.0053122 0.4010971 0.6333223
ts wk.7200 2018-06-20 7200 0.0009220 0.0009213 0.0190960 0.1381881
ts wk.7200 2018-06-21 7200 0.0019756 0.0019765 0.0688409 0.2623755
ts wk.7200 2018-06-22 7200 0.0006667 0.0006665 0.0087705 0.0936507
ts wk.7200 2018-06-23 5 0.0000121 0.0000121 0.0000018 0.0013275
ts wk.7200 2018-06-25 7195 0.0035498 0.0035570 0.1753596 0.4187596
ts wk.7200 2018-06-26 7200 0.0016588 0.0016587 0.0462353 0.2150239
ts wk.7200 2018-06-27 7200 0.0016475 0.0016468 0.0434671 0.2084877
ts wk.7200 2018-06-28 7200 0.0008682 0.0008679 0.0167661 0.1294839
ts wk.7200 2018-06-29 7200 0.0015295 0.0015279 0.0395188 0.1987934
ts wk.7200 2018-06-30 5 0.0017294 0.0017280 0.0365186 0.1910984
ts wk.7200 2018-07-02 7195 0.0010502 0.0010493 0.0212118 0.1456428
ts wk.7200 2018-07-03 7200 0.0012720 0.0012733 0.0349115 0.1868462
ts wk.7200 2018-07-04 7200 0.0010274 0.0010281 0.0163644 0.1279235
ts wk.7200 2018-07-05 7200 0.0009804 0.0009800 0.0141518 0.1189613
ts wk.7200 2018-07-06 7200 0.0008002 0.0008006 0.0130965 0.1144399
ts wk.7200 2018-07-07 5 0.0016406 0.0016419 0.0329496 0.1815203
ts yr.1440 2018-01-03 1439 0.0007286 0.0007281 0.0115161 0.1073129
ts yr.1440 2018-01-04 1440 0.0022569 0.0022540 0.0734649 0.2710440
ts yr.1440 2018-01-05 1440 0.0032410 0.0032344 0.1681745 0.4100909
ts yr.1440 2018-01-06 1 0.0028941 0.0028899 0.1064477 0.3262632
ts yr.1440 2018-01-08 1439 0.0008377 0.0008373 0.0126258 0.1123644
ts yr.1440 2018-01-09 1440 0.0034149 0.0034220 0.1811900 0.4256642
ts yr.1440 2018-01-10 1440 0.0069793 0.0070122 0.8300368 0.9110636
ts yr.1440 2018-01-11 1440 0.0020285 0.0020267 0.0695032 0.2636345
ts yr.1440 2018-01-12 1440 0.0009401 0.0009403 0.0187880 0.1370693
ts yr.1440 2018-01-13 1 0.0021296 0.0021319 0.0561425 0.2369441
ts yr.1440 2018-01-15 1439 0.0031574 0.0031632 0.1429524 0.3780904
ts yr.1440 2018-01-16 1440 0.0020256 0.0020232 0.0640146 0.2530111
ts yr.1440 2018-01-17 1440 0.0025736 0.0025692 0.1147251 0.3387109
ts yr.1440 2018-01-18 1440 0.0011139 0.0011150 0.0300460 0.1733379
ts yr.1440 2018-01-19 1440 0.0031785 0.0031845 0.1461572 0.3823051
ts yr.1440 2018-01-20 1 0.0025213 0.0025245 0.0784868 0.2801549
ts yr.1440 2018-01-22 1439 0.0011068 0.0011060 0.0292804 0.1711151
ts yr.1440 2018-01-23 1440 0.0024627 0.0024671 0.1107709 0.3328226
ts yr.1440 2018-01-24 1440 0.0057013 0.0057232 0.5301945 0.7281446
ts yr.1440 2018-01-25 1440 0.0018044 0.0018061 0.0604222 0.2458092
ts yr.1440 2018-01-26 1440 0.0029688 0.0029750 0.1745773 0.4178245
ts yr.1440 2018-01-27 1 0.0071595 0.0071853 0.6136259 0.7833428
ts yr.1440 2018-01-29 1439 0.0026351 0.0026299 0.1238625 0.3519410
ts yr.1440 2018-01-30 1440 0.0014949 0.0014964 0.0367623 0.1917349
ts yr.1440 2018-01-31 1440 0.0020716 0.0020674 0.1014602 0.3185282
ts yr.1440 2018-02-01 1440 0.0027117 0.0027065 0.1241716 0.3523799
ts yr.1440 2018-02-02 1440 0.0045717 0.0045563 0.3732799 0.6109664
ts yr.1440 2018-02-03 1 0.0070643 0.0070394 0.5972853 0.7728423
ts yr.1440 2018-02-05 1439 0.0027286 0.0027340 0.1329068 0.3645639
ts yr.1440 2018-02-06 1440 0.0019107 0.0019117 0.0742761 0.2725365
ts yr.1440 2018-02-07 1440 0.0021799 0.0021832 0.0797766 0.2824475
ts yr.1440 2018-02-08 1440 0.0027627 0.0027637 0.1335827 0.3654897
ts yr.1440 2018-02-09 1440 0.0020273 0.0020275 0.0733162 0.2707697
ts yr.1440 2018-02-10 1 0.0004384 0.0004383 0.0022725 0.0476703
ts yr.1440 2018-02-12 1439 0.0015453 0.0015469 0.0396262 0.1990634
ts yr.1440 2018-02-13 1440 0.0066779 0.0067093 0.7417352 0.8612405
ts yr.1440 2018-02-14 1440 0.0047591 0.0047739 0.3441722 0.5866619
ts yr.1440 2018-02-15 1440 0.0045304 0.0045426 0.2775753 0.5268541
ts yr.1440 2018-02-16 1440 0.0011766 0.0011771 0.0263064 0.1621925
ts yr.1440 2018-02-17 1 0.0015973 0.0015960 0.0287414 0.1695328
ts yr.1440 2018-02-19 1439 0.0023227 0.0023194 0.0767605 0.2770569
ts yr.1440 2018-02-20 1440 0.0043175 0.0043060 0.2612627 0.5111386
ts yr.1440 2018-02-21 1440 0.0028600 0.0028545 0.1260728 0.3550673
ts yr.1440 2018-02-22 1440 0.0051380 0.0051556 0.4059544 0.6371455
ts yr.1440 2018-02-23 1440 0.0012329 0.0012318 0.0275998 0.1661320
ts yr.1440 2018-02-24 1 0.0013198 0.0013190 0.0198509 0.1408931
ts yr.1440 2018-02-26 1439 0.0017950 0.0017963 0.0479682 0.2190165
ts yr.1440 2018-02-27 1440 0.0020228 0.0020191 0.0865509 0.2941954
ts yr.1440 2018-02-28 1440 0.0024919 0.0024970 0.1178464 0.3432877
ts yr.1440 2018-03-01 1440 0.0016436 0.0016431 0.0462300 0.2150116
ts yr.1440 2018-03-02 1440 0.0048190 0.0048344 0.3471929 0.5892308
ts yr.1440 2018-03-03 1 0.0047346 0.0047458 0.2529617 0.5029530
ts yr.1440 2018-03-05 1439 0.0018016 0.0018001 0.0612390 0.2474651
ts yr.1440 2018-03-06 1440 0.0011791 0.0011788 0.0240258 0.1550026
ts yr.1440 2018-03-07 1440 0.0029573 0.0029629 0.1258242 0.3547171
ts yr.1440 2018-03-08 1440 0.0011230 0.0011222 0.0184723 0.1359129
ts yr.1440 2018-03-09 1440 0.0055152 0.0054987 0.3725929 0.6104039
ts yr.1440 2018-03-10 1 0.0056884 0.0056723 0.3651129 0.6042457
ts yr.1440 2018-03-12 1439 0.0020961 0.0020989 0.0657168 0.2563528
ts yr.1440 2018-03-13 1440 0.0033617 0.0033527 0.2064085 0.4543220
ts yr.1440 2018-03-14 1440 0.0013898 0.0013914 0.0367829 0.1917888
ts yr.1440 2018-03-15 1440 0.0023566 0.0023602 0.0817396 0.2859014
ts yr.1440 2018-03-16 1440 0.0029440 0.0029500 0.1359519 0.3687166
ts yr.1440 2018-03-17 1 0.0033886 0.0033944 0.1298567 0.3603564
ts yr.1440 2018-03-19 1439 0.0009625 0.0009622 0.0159425 0.1262636
ts yr.1440 2018-03-20 1440 0.0027069 0.0027025 0.1002939 0.3166921
ts yr.1440 2018-03-21 1440 0.0015849 0.0015871 0.0513978 0.2267107
ts yr.1440 2018-03-22 1440 0.0032062 0.0032131 0.1546442 0.3932483
ts yr.1440 2018-03-23 1440 0.0029472 0.0029523 0.1132850 0.3365784
ts yr.1440 2018-03-24 1 0.0051780 0.0051914 0.2971834 0.5451453
ts yr.1440 2018-03-26 1439 0.0032517 0.0032454 0.1379356 0.3713968
ts yr.1440 2018-03-27 1440 0.0024060 0.0024025 0.0771220 0.2777085
ts yr.1440 2018-03-28 1440 0.0052441 0.0052204 0.5298671 0.7279197
ts yr.1440 2018-03-29 1440 0.0026057 0.0026103 0.1091210 0.3303346
ts yr.1440 2018-03-30 1440 0.0016504 0.0016520 0.0375683 0.1938253
ts yr.1440 2018-03-31 1 0.0013316 0.0013325 0.0200835 0.1417161
ts yr.1440 2018-04-02 1439 0.0015272 0.0015288 0.0507477 0.2252724
ts yr.1440 2018-04-03 1440 0.0027708 0.0027647 0.1400728 0.3742630
ts yr.1440 2018-04-04 1440 0.0015243 0.0015265 0.0540027 0.2323847
ts yr.1440 2018-04-05 1440 0.0034801 0.0034721 0.1825493 0.4272579
ts yr.1440 2018-04-06 1440 0.0017790 0.0017816 0.0632165 0.2514290
ts yr.1440 2018-04-07 1 0.0041705 0.0041792 0.2005684 0.4478487
ts yr.1440 2018-04-09 1439 0.0012204 0.0012198 0.0242368 0.1556818
ts yr.1440 2018-04-10 1440 0.0027450 0.0027402 0.1094158 0.3307806
ts yr.1440 2018-04-11 1440 0.0020957 0.0020988 0.0716817 0.2677344
ts yr.1440 2018-04-12 1440 0.0023470 0.0023426 0.0993388 0.3151806
ts yr.1440 2018-04-13 1440 0.0014241 0.0014224 0.0394478 0.1986148
ts yr.1440 2018-04-14 1 0.0002794 0.0002794 0.0008994 0.0299893
ts yr.1440 2018-04-16 1439 0.0017028 0.0017041 0.0377932 0.1944047
ts yr.1440 2018-04-17 1440 0.0008719 0.0008725 0.0125108 0.1118516
ts yr.1440 2018-04-18 1440 0.0018023 0.0018003 0.0459748 0.2144173
ts yr.1440 2018-04-19 1440 0.0008828 0.0008822 0.0120747 0.1098849
ts yr.1440 2018-04-20 1440 0.0015771 0.0015756 0.0351354 0.1874444
ts yr.1440 2018-04-21 1 0.0025328 0.0025296 0.0739536 0.2719442
ts yr.1440 2018-04-23 1439 0.0040095 0.0039958 0.3188367 0.5646563
ts yr.1440 2018-04-24 1440 0.0008568 0.0008561 0.0186719 0.1366451
ts yr.1440 2018-04-25 1440 0.0023206 0.0023165 0.0971058 0.3116181
ts yr.1440 2018-04-26 1440 0.0012891 0.0012903 0.0292572 0.1710473
ts yr.1440 2018-04-27 1440 0.0009652 0.0009660 0.0195378 0.1397777
ts yr.1440 2018-04-28 1 0.0021960 0.0021984 0.0576079 0.2400164
ts yr.1440 2018-04-30 1439 0.0013754 0.0013741 0.0318968 0.1785967
ts yr.1440 2018-05-01 1440 0.0018091 0.0018065 0.0636554 0.2523003
ts yr.1440 2018-05-02 1440 0.0006240 0.0006242 0.0068311 0.0826506
ts yr.1440 2018-05-03 1440 0.0031199 0.0031277 0.1863365 0.4316671
ts yr.1440 2018-05-04 1440 0.0008645 0.0008651 0.0159982 0.1264838
ts yr.1440 2018-05-05 1 0.0011169 0.0011175 0.0148753 0.1219645
ts yr.1440 2018-05-07 1439 0.0011128 0.0011121 0.0220492 0.1484896
ts yr.1440 2018-05-08 1440 0.0007871 0.0007874 0.0115642 0.1075371
ts yr.1440 2018-05-09 1440 0.0042863 0.0042756 0.2557127 0.5056804
ts yr.1440 2018-05-10 1440 0.0014158 0.0014172 0.0399857 0.1999642
ts yr.1440 2018-05-11 1440 0.0008593 0.0008596 0.0126576 0.1125061
ts yr.1440 2018-05-12 1 0.0000814 0.0000814 0.0000793 0.0089056
ts yr.1440 2018-05-14 1439 0.0009817 0.0009810 0.0184651 0.1358862
ts yr.1440 2018-05-15 1440 0.0030468 0.0030394 0.1779800 0.4218768
ts yr.1440 2018-05-16 1440 0.0011532 0.0011541 0.0236384 0.1537478
ts yr.1440 2018-05-17 1440 0.0020097 0.0020072 0.0693756 0.2633925
ts yr.1440 2018-05-18 1440 0.0011827 0.0011818 0.0239644 0.1548044
ts yr.1440 2018-05-19 1 0.0001350 0.0001350 0.0002237 0.0149578
ts yr.1440 2018-05-21 1439 0.0036315 0.0036242 0.1807371 0.4251319
ts yr.1440 2018-05-22 1440 0.0010908 0.0010916 0.0189772 0.1377577
ts yr.1440 2018-05-23 1440 0.0057808 0.0058035 0.5560307 0.7456747
ts yr.1440 2018-05-24 1440 0.0045584 0.0045714 0.3154355 0.5616364
ts yr.1440 2018-05-25 1440 0.0019992 0.0019966 0.0644089 0.2537892
ts yr.1440 2018-05-26 1 0.0012669 0.0012661 0.0191556 0.1384039
ts yr.1440 2018-05-28 1439 0.0008982 0.0008974 0.0204749 0.1430905
ts yr.1440 2018-05-29 1440 0.0046156 0.0046295 0.3307554 0.5751134
ts yr.1440 2018-05-30 1440 0.0014692 0.0014692 0.0340658 0.1845691
ts yr.1440 2018-05-31 1440 0.0013646 0.0013659 0.0304835 0.1745952
ts yr.1440 2018-06-01 1440 0.0044958 0.0044827 0.3110066 0.5576797
ts yr.1440 2018-06-02 1 0.0064868 0.0064658 0.4982169 0.7058448
ts yr.1440 2018-06-04 1439 0.0012125 0.0012115 0.0245189 0.1565852
ts yr.1440 2018-06-05 1440 0.0008150 0.0008149 0.0115294 0.1073752
ts yr.1440 2018-06-06 1440 0.0024150 0.0024113 0.0902119 0.3003529
ts yr.1440 2018-06-07 1440 0.0018571 0.0018596 0.0608236 0.2466245
ts yr.1440 2018-06-08 1440 0.0015612 0.0015629 0.0435067 0.2085825
ts yr.1440 2018-06-09 1 0.0015622 0.0015635 0.0293723 0.1713835
ts yr.1440 2018-06-11 1439 0.0033370 0.0033300 0.1714798 0.4141011
ts yr.1440 2018-06-12 1440 0.0022838 0.0022808 0.0728401 0.2698891
ts yr.1440 2018-06-13 1440 0.0013310 0.0013297 0.0305683 0.1748379
ts yr.1440 2018-06-14 1440 0.0020519 0.0020538 0.0686272 0.2619679
ts yr.1440 2018-06-15 1440 0.0006625 0.0006623 0.0086253 0.0928725
ts yr.1440 2018-06-16 1 0.0002994 0.0002993 0.0010969 0.0331195
ts yr.1440 2018-06-18 1439 0.0013561 0.0013572 0.0283490 0.1683716
ts yr.1440 2018-06-19 1440 0.0050897 0.0051049 0.3703398 0.6085555
ts yr.1440 2018-06-20 1440 0.0016890 0.0016873 0.0424919 0.2061357
ts yr.1440 2018-06-21 1440 0.0023272 0.0023267 0.0843180 0.2903756
ts yr.1440 2018-06-22 1440 0.0009191 0.0009184 0.0178552 0.1336232
ts yr.1440 2018-06-23 1 0.0000145 0.0000145 0.0000026 0.0015975
ts yr.1440 2018-06-25 1439 0.0031427 0.0031486 0.1407032 0.3751043
ts yr.1440 2018-06-26 1440 0.0014587 0.0014573 0.0470950 0.2170139
ts yr.1440 2018-06-27 1440 0.0016095 0.0016074 0.0564145 0.2375173
ts yr.1440 2018-06-28 1440 0.0011744 0.0011734 0.0258519 0.1607852
ts yr.1440 2018-06-29 1440 0.0022784 0.0022752 0.0781593 0.2795699
ts yr.1440 2018-06-30 1 0.0017049 0.0017034 0.0354899 0.1883877
ts yr.1440 2018-07-02 1439 0.0015521 0.0015504 0.0413679 0.2033911
ts yr.1440 2018-07-03 1440 0.0014004 0.0014012 0.0369248 0.1921582
ts yr.1440 2018-07-04 1440 0.0007003 0.0007006 0.0087622 0.0936068
ts yr.1440 2018-07-05 1440 0.0010737 0.0010730 0.0188191 0.1371828
ts yr.1440 2018-07-06 1440 0.0009016 0.0009019 0.0152644 0.1235490
ts yr.1440 2018-07-07 1 0.0016391 0.0016405 0.0328911 0.1813590
plt_s2 %>% 
  kbl('html', caption = 'Data Sample', escape = FALSE) %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>%
  scroll_box(width = '100%', height = '400px')
Data Sample
Model Period index N open.mape open.smape open.mse open.rmse
tbats dy.qt 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.qt 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.qt 2018-01-05 1440 0.0033109 0.0033042 0.1712639 0.4138404
tbats dy.qt 2018-01-06 1 0.0033901 0.0033844 0.1459240 0.3820000
tbats dy.qt 2018-01-08 1439 0.0039391 0.0039311 0.2050751 0.4528522
tbats dy.qt 2018-01-09 1440 0.0012943 0.0012931 0.0419181 0.2047390
tbats dy.qt 2018-01-10 1440 0.0073048 0.0073400 0.8879488 0.9423103
tbats dy.qt 2018-01-11 1440 0.0103775 0.0104334 1.4110712 1.1878852
tbats dy.qt 2018-01-12 1440 0.0130046 0.0130904 2.1649021 1.4713606
tbats dy.qt 2018-01-13 1 0.0147054 0.0148143 2.7456490 1.6570000
tbats dy.qt 2018-01-15 1439 0.0177735 0.0179342 4.0444477 2.0110812
tbats dy.qt 2018-01-16 1440 0.0175204 0.0176763 3.9235329 1.9807910
tbats dy.qt 2018-01-17 1440 0.0173391 0.0174925 3.8604893 1.9648128
tbats dy.qt 2018-01-18 1440 0.0132828 0.0133725 2.2636575 1.5045456
tbats dy.qt 2018-01-19 1440 0.0169647 0.0171110 3.6821392 1.9188901
tbats dy.qt 2018-01-20 1 0.0163738 0.0165090 3.4040250 1.8450000
tbats dy.qt 2018-01-22 1439 0.0164475 0.0165846 3.4523110 1.8580396
tbats dy.qt 2018-01-23 1440 0.0180156 0.0181820 4.1856644 2.0458896
tbats dy.qt 2018-01-24 1440 0.0268881 0.0272614 9.3470521 3.0572949
tbats dy.qt 2018-01-25 1440 0.0322722 0.0328036 13.2754630 3.6435509
tbats dy.qt 2018-01-26 1440 0.0318377 0.0323591 13.0263583 3.6092047
tbats dy.qt 2018-01-27 1 0.0359514 0.0366094 16.4106010 4.0510000
tbats dy.qt 2018-01-29 1439 0.0339983 0.0345871 14.6966838 3.8336254
tbats dy.qt 2018-01-30 1440 0.0346458 0.0352574 15.2604667 3.9064647
tbats dy.qt 2018-01-31 1440 0.0333584 0.0339260 14.1707246 3.7644023
tbats dy.qt 2018-02-01 1440 0.0288410 0.0292640 10.5843271 3.2533563
tbats dy.qt 2018-02-02 1440 0.0249175 0.0252362 7.9895620 2.8265813
tbats dy.qt 2018-02-03 1 0.0222400 0.0224901 6.2800360 2.5060000
tbats dy.qt 2018-02-05 1439 0.0247250 0.0250364 7.8101566 2.7946657
tbats dy.qt 2018-02-06 1440 0.0316136 0.0321241 12.7564999 3.5716243
tbats dy.qt 2018-02-07 1440 0.0298147 0.0302673 11.3204578 3.3645888
tbats dy.qt 2018-02-08 1440 0.0295570 0.0300045 11.1915858 3.3453828
tbats dy.qt 2018-02-09 1440 0.0340752 0.0346683 14.8008132 3.8471825
tbats dy.qt 2018-02-10 1 0.0344693 0.0350738 15.0854560 3.8840000
tbats dy.qt 2018-02-12 1439 0.0355512 0.0361948 16.0525253 4.0065603
tbats dy.qt 2018-02-13 1440 0.0415012 0.0423895 22.0797777 4.6989124
tbats dy.qt 2018-02-14 1440 0.0478455 0.0490216 29.1477209 5.3988629
tbats dy.qt 2018-02-15 1440 0.0548283 0.0563755 38.2107906 6.1814877
tbats dy.qt 2018-02-16 1440 0.0585071 0.0602717 43.4960112 6.5951506
tbats dy.qt 2018-02-17 1 0.0565673 0.0582138 40.6278760 6.3740000
tbats dy.qt 2018-02-19 1439 0.0018810 0.0018789 0.0502889 0.2242519
tbats dy.qt 2018-02-20 1440 0.0039150 0.0039051 0.2257944 0.4751782
tbats dy.qt 2018-02-21 1440 0.0025510 0.0025468 0.0960670 0.3099467
tbats dy.qt 2018-02-22 1440 0.0053739 0.0053927 0.4358929 0.6602219
tbats dy.qt 2018-02-23 1440 0.0010663 0.0010658 0.0193807 0.1392147
tbats dy.qt 2018-02-24 1 0.0012813 0.0012805 0.0187112 0.1367888
tbats dy.qt 2018-02-26 1439 0.0017207 0.0017224 0.0487130 0.2207101
tbats dy.qt 2018-02-27 1440 0.0017627 0.0017597 0.0692587 0.2631706
tbats dy.qt 2018-02-28 1440 0.0028550 0.0028609 0.1383402 0.3719411
tbats dy.qt 2018-03-01 1440 0.0014258 0.0014257 0.0407300 0.2018167
tbats dy.qt 2018-03-02 1440 0.0044554 0.0044691 0.3069946 0.5540710
tbats dy.qt 2018-03-03 1 0.0047471 0.0047584 0.2543040 0.5042856
tbats dy.qt 2018-03-05 1439 0.0020813 0.0020805 0.0656674 0.2562565
tbats dy.qt 2018-03-06 1440 0.0010507 0.0010510 0.0191561 0.1384056
tbats dy.qt 2018-03-07 1440 0.0032845 0.0032912 0.1519726 0.3898366
tbats dy.qt 2018-03-08 1440 0.0006005 0.0006004 0.0064385 0.0802403
tbats dy.qt 2018-03-09 1440 0.0048093 0.0047965 0.2887926 0.5373943
tbats dy.qt 2018-03-10 1 0.0057372 0.0057207 0.3713635 0.6093960
tbats dy.qt 2018-03-12 1439 0.0023390 0.0023423 0.0759089 0.2755157
tbats dy.qt 2018-03-13 1440 0.0028999 0.0028931 0.1572071 0.3964935
tbats dy.qt 2018-03-14 1440 0.0013291 0.0013305 0.0331019 0.1819393
tbats dy.qt 2018-03-15 1440 0.0023845 0.0023882 0.0828577 0.2878502
tbats dy.qt 2018-03-16 1440 0.0033274 0.0033348 0.1665281 0.4080786
tbats dy.qt 2018-03-17 1 0.0034003 0.0034061 0.1307541 0.3615994
tbats dy.qt 2018-03-19 1439 0.0011850 0.0011852 0.0217987 0.1476438
tbats dy.qt 2018-03-20 1440 0.0022856 0.0022823 0.0757474 0.2752225
tbats dy.qt 2018-03-21 1440 0.0017213 0.0017237 0.0554248 0.2354247
tbats dy.qt 2018-03-22 1440 0.0034462 0.0034537 0.1688976 0.4109715
tbats dy.qt 2018-03-23 1440 0.0032304 0.0032366 0.1360697 0.3688763
tbats dy.qt 2018-03-24 1 0.0051877 0.0052012 0.2983075 0.5461754
tbats dy.qt 2018-03-26 1439 0.0028861 0.0028807 0.1198734 0.3462273
tbats dy.qt 2018-03-27 1440 0.0019733 0.0019708 0.0548570 0.2342156
tbats dy.qt 2018-03-28 1440 0.0054888 0.0054627 0.5830772 0.7635949
tbats dy.qt 2018-03-29 1440 0.0026981 0.0027027 0.1069173 0.3269821
tbats dy.qt 2018-03-30 1440 0.0017376 0.0017394 0.0399285 0.1998213
tbats dy.qt 2018-03-31 1 0.0013576 0.0013585 0.0208770 0.1444887
tbats dy.qt 2018-04-02 1439 0.0011295 0.0011310 0.0377658 0.1943343
tbats dy.qt 2018-04-03 1440 0.0027903 0.0027837 0.1511955 0.3888386
tbats dy.qt 2018-04-04 1440 0.0017291 0.0017314 0.0600898 0.2451322
tbats dy.qt 2018-04-05 1440 0.0028588 0.0028526 0.1439445 0.3794002
tbats dy.qt 2018-04-06 1440 0.0017676 0.0017703 0.0636784 0.2523457
tbats dy.qt 2018-04-07 1 0.0041444 0.0041530 0.1980616 0.4450411
tbats dy.qt 2018-04-09 1439 0.0009020 0.0009017 0.0139755 0.1182182
tbats dy.qt 2018-04-10 1440 0.0024381 0.0024343 0.0871189 0.2951591
tbats dy.qt 2018-04-11 1440 0.0020890 0.0020920 0.0689188 0.2625239
tbats dy.qt 2018-04-12 1440 0.0022921 0.0022879 0.0981073 0.3132209
tbats dy.qt 2018-04-13 1440 0.0015270 0.0015252 0.0423808 0.2058660
tbats dy.qt 2018-04-14 1 0.0003289 0.0003289 0.0012460 0.0352982
tbats dy.qt 2018-04-16 1439 0.0012836 0.0012842 0.0236461 0.1537730
tbats dy.qt 2018-04-17 1440 0.0006967 0.0006970 0.0083520 0.0913892
tbats dy.qt 2018-04-18 1440 0.0020366 0.0020342 0.0562271 0.2371224
tbats dy.qt 2018-04-19 1440 0.0012621 0.0012611 0.0218887 0.1479484
tbats dy.qt 2018-04-20 1440 0.0020490 0.0020465 0.0577120 0.2402333
tbats dy.qt 2018-04-21 1 0.0025545 0.0025513 0.0752254 0.2742725
tbats dy.qt 2018-04-23 1439 0.0045611 0.0045455 0.3645420 0.6037731
tbats dy.qt 2018-04-24 1440 0.0011920 0.0011908 0.0309522 0.1759325
tbats dy.qt 2018-04-25 1440 0.0027018 0.0026968 0.1197275 0.3460166
tbats dy.qt 2018-04-26 1440 0.0010282 0.0010289 0.0189114 0.1375186
tbats dy.qt 2018-04-27 1440 0.0008721 0.0008727 0.0162402 0.1274369
tbats dy.qt 2018-04-28 1 0.0022253 0.0022278 0.0591608 0.2432299
tbats dy.qt 2018-04-30 1439 0.0014960 0.0014945 0.0372243 0.1929359
tbats dy.qt 2018-05-01 1440 0.0019179 0.0019150 0.0704245 0.2653761
tbats dy.qt 2018-05-02 1440 0.0006541 0.0006544 0.0081468 0.0902595
tbats dy.qt 2018-05-03 1440 0.0032235 0.0032314 0.1899514 0.4358341
tbats dy.qt 2018-05-04 1440 0.0010354 0.0010363 0.0206722 0.1437784
tbats dy.qt 2018-05-05 1 0.0010681 0.0010687 0.0136020 0.1166277
tbats dy.qt 2018-05-07 1439 0.0010949 0.0010943 0.0214123 0.1463294
tbats dy.qt 2018-05-08 1440 0.0008264 0.0008266 0.0120175 0.1096243
tbats dy.qt 2018-05-09 1440 0.0041053 0.0040954 0.2378058 0.4876534
tbats dy.qt 2018-05-10 1440 0.0013572 0.0013584 0.0376933 0.1941477
tbats dy.qt 2018-05-11 1440 0.0007071 0.0007073 0.0085429 0.0924277
tbats dy.qt 2018-05-12 1 0.0001085 0.0001085 0.0001408 0.0118658
tbats dy.qt 2018-05-14 1439 0.0011015 0.0011008 0.0199788 0.1413464
tbats dy.qt 2018-05-15 1440 0.0030341 0.0030269 0.1740472 0.4171897
tbats dy.qt 2018-05-16 1440 0.0010763 0.0010771 0.0198791 0.1409933
tbats dy.qt 2018-05-17 1440 0.0020281 0.0020259 0.0650995 0.2551460
tbats dy.qt 2018-05-18 1440 0.0011063 0.0011057 0.0197986 0.1407074
tbats dy.qt 2018-05-19 1 0.0001151 0.0001151 0.0001625 0.0127482
tbats dy.qt 2018-05-21 1439 0.0034661 0.0034591 0.1709283 0.4134347
tbats dy.qt 2018-05-22 1440 0.0008708 0.0008712 0.0117005 0.1081689
tbats dy.qt 2018-05-23 1440 0.0057107 0.0057324 0.5328135 0.7299408
tbats dy.qt 2018-05-24 1440 0.0049709 0.0049858 0.3584635 0.5987182
tbats dy.qt 2018-05-25 1440 0.0016291 0.0016273 0.0430735 0.2075415
tbats dy.qt 2018-05-26 1 0.0012189 0.0012181 0.0177330 0.1331653
tbats dy.qt 2018-05-28 1439 0.0008189 0.0008182 0.0181025 0.1345455
tbats dy.qt 2018-05-29 1440 0.0046705 0.0046848 0.3398971 0.5830070
tbats dy.qt 2018-05-30 1440 0.0013349 0.0013351 0.0273525 0.1653860
tbats dy.qt 2018-05-31 1440 0.0015381 0.0015397 0.0399489 0.1998722
tbats dy.qt 2018-06-01 1440 0.0039078 0.0038975 0.2453799 0.4953583
tbats dy.qt 2018-06-02 1 0.0064259 0.0064053 0.4889655 0.6992607
tbats dy.qt 2018-06-04 1439 0.0009630 0.0009623 0.0173505 0.1317215
tbats dy.qt 2018-06-05 1440 0.0006841 0.0006843 0.0091039 0.0954142
tbats dy.qt 2018-06-06 1440 0.0020115 0.0020087 0.0660523 0.2570064
tbats dy.qt 2018-06-07 1440 0.0020819 0.0020849 0.0739407 0.2719204
tbats dy.qt 2018-06-08 1440 0.0016482 0.0016502 0.0492317 0.2218821
tbats dy.qt 2018-06-09 1 0.0015419 0.0015431 0.0286111 0.1691482
tbats dy.qt 2018-06-11 1439 0.0031046 0.0030989 0.1424658 0.3774465
tbats dy.qt 2018-06-12 1440 0.0022461 0.0022432 0.0699830 0.2645429
tbats dy.qt 2018-06-13 1440 0.0013507 0.0013493 0.0326393 0.1806636
tbats dy.qt 2018-06-14 1440 0.0017004 0.0017015 0.0502469 0.2241582
tbats dy.qt 2018-06-15 1440 0.0007257 0.0007257 0.0098517 0.0992559
tbats dy.qt 2018-06-16 1 0.0003011 0.0003011 0.0011100 0.0333167
tbats dy.qt 2018-06-18 1439 0.0014155 0.0014167 0.0292128 0.1709174
tbats dy.qt 2018-06-19 1440 0.0052962 0.0053126 0.4011633 0.6333746
tbats dy.qt 2018-06-20 1440 0.0009143 0.0009136 0.0188498 0.1372944
tbats dy.qt 2018-06-21 1440 0.0019756 0.0019765 0.0688398 0.2623733
tbats dy.qt 2018-06-22 1440 0.0006666 0.0006664 0.0087973 0.0937939
tbats dy.qt 2018-06-23 1 0.0000166 0.0000166 0.0000034 0.0018304
tbats dy.qt 2018-06-25 1439 0.0035492 0.0035565 0.1753105 0.4187009
tbats dy.qt 2018-06-26 1440 0.0016580 0.0016579 0.0462228 0.2149950
tbats dy.qt 2018-06-27 1440 0.0016472 0.0016466 0.0434048 0.2083381
tbats dy.qt 2018-06-28 1440 0.0008681 0.0008678 0.0167567 0.1294476
tbats dy.qt 2018-06-29 1440 0.0015291 0.0015275 0.0394970 0.1987385
tbats dy.qt 2018-06-30 1 0.0017288 0.0017273 0.0364923 0.1910297
tbats dy.qt 2018-07-02 1439 0.0010487 0.0010478 0.0211690 0.1454958
tbats dy.qt 2018-07-03 1440 0.0012694 0.0012706 0.0347796 0.1864930
tbats dy.qt 2018-07-04 1440 0.0010272 0.0010279 0.0163587 0.1279010
tbats dy.qt 2018-07-05 1440 0.0009826 0.0009822 0.0142237 0.1192630
tbats dy.qt 2018-07-06 1440 0.0008012 0.0008016 0.0131406 0.1146326
tbats dy.qt 2018-07-07 1 0.0016441 0.0016454 0.0330902 0.1819072
tbats dy.yr 2018-01-03 1439 0.0031414 0.0031467 0.1318562 0.3631201
tbats dy.yr 2018-01-04 1440 0.0007263 0.0007263 0.0088109 0.0938664
tbats dy.yr 2018-01-05 1440 0.0033109 0.0033042 0.1712639 0.4138404
tbats dy.yr 2018-01-06 1 0.0033901 0.0033844 0.1459240 0.3820000
tbats dy.yr 2018-01-08 1439 0.0039391 0.0039311 0.2050746 0.4528517
tbats dy.yr 2018-01-09 1440 0.0012943 0.0012931 0.0419181 0.2047390
tbats dy.yr 2018-01-10 1440 0.0073048 0.0073400 0.8879488 0.9423103
tbats dy.yr 2018-01-11 1440 0.0103775 0.0104334 1.4110712 1.1878852
tbats dy.yr 2018-01-12 1440 0.0130046 0.0130904 2.1649021 1.4713606
tbats dy.yr 2018-01-13 1 0.0147054 0.0148143 2.7456490 1.6570000
tbats dy.yr 2018-01-15 1439 0.0177735 0.0179342 4.0444477 2.0110812
tbats dy.yr 2018-01-16 1440 0.0175204 0.0176763 3.9235329 1.9807910
tbats dy.yr 2018-01-17 1440 0.0173391 0.0174925 3.8604893 1.9648128
tbats dy.yr 2018-01-18 1440 0.0132828 0.0133725 2.2636575 1.5045456
tbats dy.yr 2018-01-19 1440 0.0169647 0.0171110 3.6821392 1.9188901
tbats dy.yr 2018-01-20 1 0.0163738 0.0165090 3.4040250 1.8450000
tbats dy.yr 2018-01-22 1439 0.0164475 0.0165846 3.4523110 1.8580396
tbats dy.yr 2018-01-23 1440 0.0180156 0.0181820 4.1856644 2.0458896
tbats dy.yr 2018-01-24 1440 0.0268881 0.0272614 9.3470597 3.0572961
tbats dy.yr 2018-01-25 1440 0.0322722 0.0328036 13.2754674 3.6435515
tbats dy.yr 2018-01-26 1440 0.0318377 0.0323591 13.0263583 3.6092047
tbats dy.yr 2018-01-27 1 0.0359514 0.0366094 16.4106010 4.0510000
tbats dy.yr 2018-01-29 1439 0.0339983 0.0345871 14.6966838 3.8336254
tbats dy.yr 2018-01-30 1440 0.0346458 0.0352574 15.2604667 3.9064647
tbats dy.yr 2018-01-31 1440 0.0333584 0.0339260 14.1707246 3.7644023
tbats dy.yr 2018-02-01 1440 0.0288410 0.0292640 10.5843271 3.2533563
tbats dy.yr 2018-02-02 1440 0.0249175 0.0252362 7.9895620 2.8265813
tbats dy.yr 2018-02-03 1 0.0222400 0.0224901 6.2800360 2.5060000
tbats dy.yr 2018-02-05 1439 0.0247250 0.0250364 7.8101566 2.7946657
tbats dy.yr 2018-02-06 1440 0.0316136 0.0321241 12.7564999 3.5716243
tbats dy.yr 2018-02-07 1440 0.0298147 0.0302673 11.3204578 3.3645888
tbats dy.yr 2018-02-08 1440 0.0295570 0.0300045 11.1915858 3.3453828
tbats dy.yr 2018-02-09 1440 0.0340752 0.0346683 14.8008132 3.8471825
tbats dy.yr 2018-02-10 1 0.0344693 0.0350738 15.0854560 3.8840000
tbats dy.yr 2018-02-12 1439 0.0355512 0.0361948 16.0525253 4.0065603
tbats dy.yr 2018-02-13 1440 0.0415012 0.0423895 22.0797777 4.6989124
tbats dy.yr 2018-02-14 1440 0.0478455 0.0490216 29.1477209 5.3988629
tbats dy.yr 2018-02-15 1440 0.0548283 0.0563755 38.2107906 6.1814877
tbats dy.yr 2018-02-16 1440 0.0585071 0.0602717 43.4960112 6.5951506
tbats dy.yr 2018-02-17 1 0.0565673 0.0582138 40.6278760 6.3740000
tbats dy.yr 2018-02-19 1439 0.0550766 0.0566373 38.5369395 6.2078128
tbats dy.yr 2018-02-20 1440 0.0503269 0.0516282 32.2105882 5.6754373
tbats dy.yr 2018-02-21 1440 0.0451023 0.0461438 25.8503062 5.0843196
tbats dy.yr 2018-02-22 1440 0.0486687 0.0498868 30.1747998 5.4931594
tbats dy.yr 2018-02-23 1440 0.0520678 0.0534602 34.4368323 5.8682904
tbats dy.yr 2018-02-24 1 0.0513756 0.0527301 33.5125210 5.7890000
tbats dy.yr 2018-02-26 1439 0.0523297 0.0537373 34.8061849 5.8996767
tbats dy.yr 2018-02-27 1440 0.0495722 0.0508339 31.2421536 5.5894681
tbats dy.yr 2018-02-28 1440 0.0500147 0.0512998 31.8154528 5.6405188
tbats dy.yr 2018-03-01 1440 0.0528801 0.0543178 35.5425360 5.9617561
tbats dy.yr 2018-03-02 1440 0.0614139 0.0633632 47.9736591 6.9263020
tbats dy.yr 2018-03-03 1 0.0617146 0.0636796 48.3581160 6.9540000
tbats dy.yr 2018-03-05 1439 0.0618393 0.0638152 48.6191767 6.9727453
tbats dy.yr 2018-03-06 1440 0.0576352 0.0593462 42.1946350 6.4957398
tbats dy.yr 2018-03-07 1440 0.0611436 0.0630732 47.4988149 6.8919384
tbats dy.yr 2018-03-08 1440 0.0583970 0.0601537 43.3046139 6.5806241
tbats dy.yr 2018-03-09 1440 0.0528147 0.0542485 35.4452447 5.9535909
tbats dy.yr 2018-03-10 1 0.0519302 0.0533146 34.2400523 5.8515000
tbats dy.yr 2018-03-12 1439 0.0539580 0.0554551 36.9899617 6.0819373
tbats dy.yr 2018-03-13 1440 0.0530344 0.0544823 35.7881548 5.9823202
tbats dy.yr 2018-03-14 1440 0.0552759 0.0568478 38.8117093 6.2299044
tbats dy.yr 2018-03-15 1440 0.0586386 0.0604106 43.6777665 6.6089157
tbats dy.yr 2018-03-16 1440 0.0593666 0.0611845 44.7900387 6.6925360
tbats dy.yr 2018-03-17 1 0.0594382 0.0612588 44.8565063 6.6975000
tbats dy.yr 2018-03-19 1439 0.0596944 0.0615318 45.2649130 6.7279204
tbats dy.yr 2018-03-20 1440 0.0564654 0.0581070 40.5082290 6.3646075
tbats dy.yr 2018-03-21 1440 0.0561626 0.0577863 40.0706968 6.3301419
tbats dy.yr 2018-03-22 1440 0.0620814 0.0640717 48.9713686 6.9979546
tbats dy.yr 2018-03-23 1440 0.0686503 0.0710915 59.8598804 7.7369167
tbats dy.yr 2018-03-24 1 0.0705005 0.0730765 63.1071360 7.9440000
tbats dy.yr 2018-03-26 1439 0.0678501 0.0702341 58.4820533 7.6473560
tbats dy.yr 2018-03-27 1440 0.0627230 0.0647543 49.9636189 7.0684948
tbats dy.yr 2018-03-28 1440 0.0600072 0.0618740 45.9681799 6.7799838
tbats dy.yr 2018-03-29 1440 0.0542516 0.0557653 37.3936332 6.1150334
tbats dy.yr 2018-03-30 1440 0.0569742 0.0586453 41.2251844 6.4206841
tbats dy.yr 2018-03-31 1 0.0567403 0.0583971 40.8768423 6.3935000
tbats dy.yr 2018-04-02 1439 0.0573346 0.0590282 41.7708572 6.4630378
tbats dy.yr 2018-04-03 1440 0.0578294 0.0595547 42.5392525 6.5222122
tbats dy.yr 2018-04-04 1440 0.0551418 0.0567069 38.6452777 6.2165326
tbats dy.yr 2018-04-05 1440 0.0496996 0.0509684 31.4156586 5.6049673
tbats dy.yr 2018-04-06 1440 0.0486093 0.0498215 30.0316667 5.4801156
tbats dy.yr 2018-04-07 1 0.0509585 0.0522908 32.9705640 5.7420000
tbats dy.yr 2018-04-09 1439 0.0505655 0.0518776 32.4760320 5.6987746
tbats dy.yr 2018-04-10 1440 0.0500467 0.0513325 31.8318784 5.6419747
tbats dy.yr 2018-04-11 1440 0.0505795 0.0518926 32.5015772 5.7010155
tbats dy.yr 2018-04-12 1440 0.0500981 0.0513869 31.9055113 5.6484964
tbats dy.yr 2018-04-13 1440 0.0462221 0.0473164 27.1456958 5.2101531
tbats dy.yr 2018-04-14 1 0.0472533 0.0483967 28.3503003 5.3245000
tbats dy.yr 2018-04-16 1439 0.0480113 0.0491929 29.2834761 5.4114209
tbats dy.yr 2018-04-17 1440 0.0499536 0.0512334 31.6868643 5.6291087
tbats dy.yr 2018-04-18 1440 0.0484214 0.0496232 29.7780866 5.4569301
tbats dy.yr 2018-04-19 1440 0.0471391 0.0482772 28.2180613 5.3120675
tbats dy.yr 2018-04-20 1440 0.0451939 0.0462391 25.9423588 5.0933642
tbats dy.yr 2018-04-21 1 0.0447107 0.0457331 25.3814440 5.0380000
tbats dy.yr 2018-04-23 1439 0.0403732 0.0412102 20.8190835 4.5627934
tbats dy.yr 2018-04-24 1440 0.0342189 0.0348152 14.8829677 3.8578450
tbats dy.yr 2018-04-25 1440 0.0316863 0.0321978 12.7813704 3.5751042
tbats dy.yr 2018-04-26 1440 0.0298544 0.0303070 11.3227741 3.3649330
tbats dy.yr 2018-04-27 1440 0.0305881 0.0310636 11.8910975 3.4483471
tbats dy.yr 2018-04-28 1 0.0321441 0.0326692 13.1188840 3.6220000
tbats dy.yr 2018-04-30 1439 0.0306979 0.0311769 11.9756958 3.4605918
tbats dy.yr 2018-05-01 1440 0.0279642 0.0283622 9.9632937 3.1564685
tbats dy.yr 2018-05-02 1440 0.0253920 0.0257187 8.1921161 2.8621873
tbats dy.yr 2018-05-03 1440 0.0283529 0.0287634 10.2724713 3.2050696
tbats dy.yr 2018-05-04 1440 0.0319213 0.0324394 12.9459186 3.5980437
tbats dy.yr 2018-05-05 1 0.0319799 0.0324996 12.9852123 3.6035000
tbats dy.yr 2018-05-07 1439 0.0314228 0.0319251 12.5540949 3.5431758
tbats dy.yr 2018-05-08 1440 0.0322355 0.0327640 13.2033796 3.6336455
tbats dy.yr 2018-05-09 1440 0.0276971 0.0280882 9.7920757 3.1292292
tbats dy.yr 2018-05-10 1440 0.0268879 0.0272554 9.2076423 3.0344097
tbats dy.yr 2018-05-11 1440 0.0295278 0.0299706 11.0766470 3.3281597
tbats dy.yr 2018-05-12 1 0.0292332 0.0296669 10.8504360 3.2940000
tbats dy.yr 2018-05-14 1439 0.0285502 0.0289643 10.3633711 3.2192190
tbats dy.yr 2018-05-15 1440 0.0238221 0.0241119 7.2687680 2.6960653
tbats dy.yr 2018-05-16 1440 0.0217231 0.0219618 5.9972995 2.4489384
tbats dy.yr 2018-05-17 1440 0.0190188 0.0192032 4.6376754 2.1535263
tbats dy.yr 2018-05-18 1440 0.0162332 0.0163665 3.3582588 1.8325553
tbats dy.yr 2018-05-19 1 0.0171015 0.0172490 3.7133290 1.9270000
tbats dy.yr 2018-05-21 1439 0.0136949 0.0137903 2.4048528 1.5507588
tbats dy.yr 2018-05-22 1440 0.0152313 0.0153483 2.9492781 1.7173462
tbats dy.yr 2018-05-23 1440 0.0214290 0.0216665 5.9628655 2.4418979
tbats dy.yr 2018-05-24 1440 0.0278934 0.0282903 9.9377873 3.1524256
tbats dy.yr 2018-05-25 1440 0.0289092 0.0293338 10.6257407 3.2597148
tbats dy.yr 2018-05-26 1 0.0292155 0.0296486 10.8372640 3.2920000
tbats dy.yr 2018-05-28 1439 0.0287038 0.0291224 10.4758182 3.2366369
tbats dy.yr 2018-05-29 1440 0.0334591 0.0340318 14.2958765 3.7809888
tbats dy.yr 2018-05-30 1440 0.0348500 0.0354691 15.4474376 3.9303228
tbats dy.yr 2018-05-31 1440 0.0349467 0.0355687 15.5187281 3.9393817
tbats dy.yr 2018-06-01 1440 0.0305646 0.0310420 11.9334252 3.4544790
tbats dy.yr 2018-06-02 1 0.0280529 0.0284520 9.9919210 3.1610000
tbats dy.yr 2018-06-04 1439 0.0272565 0.0276335 9.4419288 3.0727722
tbats dy.yr 2018-06-05 1440 0.0256171 0.0259498 8.3406851 2.8880244
tbats dy.yr 2018-06-06 1440 0.0236709 0.0239552 7.1314719 2.6704816
tbats dy.yr 2018-06-07 1440 0.0241939 0.0244910 7.4534678 2.7301040
tbats dy.yr 2018-06-08 1440 0.0278386 0.0282325 9.8637981 3.1406684
tbats dy.yr 2018-06-09 1 0.0279331 0.0283287 9.9067563 3.1475000
tbats dy.yr 2018-06-11 1439 0.0253705 0.0256989 8.2308141 2.8689395
tbats dy.yr 2018-06-12 1440 0.0213017 0.0215314 5.7706147 2.4022104
tbats dy.yr 2018-06-13 1440 0.0191762 0.0193623 4.6803909 2.1634211
tbats dy.yr 2018-06-14 1440 0.0215490 0.0217855 5.9378640 2.4367733
tbats dy.yr 2018-06-15 1440 0.0182994 0.0184688 4.2613323 2.0642995
tbats dy.yr 2018-06-16 1 0.0178781 0.0180393 4.0582102 2.0145000
tbats dy.yr 2018-06-18 1439 0.0192425 0.0194297 4.7069267 2.1695453
tbats dy.yr 2018-06-19 1440 0.0241006 0.0243970 7.4340138 2.7265388
tbats dy.yr 2018-06-20 1440 0.0224995 0.0227559 6.4389355 2.5375058
tbats dy.yr 2018-06-21 1440 0.0208018 0.0210232 5.5623215 2.3584574
tbats dy.yr 2018-06-22 1440 0.0236769 0.0239609 7.1257653 2.6694129
tbats dy.yr 2018-06-23 1 0.0238995 0.0241886 7.2522490 2.6930000
tbats dy.yr 2018-06-25 1439 0.0273632 0.0277437 9.5296900 3.0870196
tbats dy.yr 2018-06-26 1440 0.0261115 0.0264588 8.7023493 2.9499745
tbats dy.yr 2018-06-27 1440 0.0231693 0.0234426 6.8580605 2.6187899
tbats dy.yr 2018-06-28 1440 0.0212360 0.0214646 5.7420078 2.3962487
tbats dy.yr 2018-06-29 1440 0.0179686 0.0181321 4.1138114 2.0282533
tbats dy.yr 2018-06-30 1 0.0176784 0.0178360 3.9680640 1.9920000
tbats dy.yr 2018-07-02 1439 0.0166676 0.0168080 3.5355166 1.8802969
tbats dy.yr 2018-07-03 1440 0.0167358 0.0168780 3.5806198 1.8922526
tbats dy.yr 2018-07-04 1440 0.0196316 0.0198264 4.8968547 2.2128838
tbats dy.yr 2018-07-05 1440 0.0009931 0.0009929 0.0174183 0.1319785
tbats dy.yr 2018-07-06 1440 0.0007986 0.0007990 0.0130234 0.1141202
tbats dy.yr 2018-07-07 1 0.0016348 0.0016361 0.0327167 0.1808775
## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p1 <- yr_2018 %>% 
  ggplot(aes(x = index, y = open, group = Model, color = Model)) + 
  geom_line() + 
  #scale_colour_gradient2_tableau(palette = names(palettes)[1]) + #first palettes list in name
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Open Price Forecasting', 
       subtitle = paste('From', range(unique(yr_2018$index))[1L], 'to', range(unique(yr_2018$index))[2L]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  ##scale_fill_manual(values = tableau_colours) + 
  #scale_color_brewer(tableau_colours) + 
  #scale_color_jcolors(palette = palettes2$`Tableau 20`$value) + #choose color set among palettes
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

## Due to heavily loading in plotly graph, here I use ggplot.
#ply1 <- ggplotly(p1)
#ply1
p1

7.1.3.0.2 High Price
rm(p1)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p2 <- yr_2018 %>% 
  ggplot(aes(x = index, y = high, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min High Price Forecasting', 
       subtitle = paste('From', range(unique(yr_2018$index))[1L], 'to', range(unique(yr_2018$index))[2L]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

## Due to heavily loading in plotly graph, here I use ggplot.
#ply2 <- ggplotly(p2)
#ply2
p2

7.1.3.0.3 Low Price
rm(p2)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p3 <- yr_2018 %>% 
  ggplot(aes(x = index, y = low, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Low Price Forecasting', 
       subtitle = paste('From', range(unique(yr_2018$index))[1], 'to', range(unique(yr_2018$index))[2]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

## Due to heavily loading in plotly graph, here I use ggplot.
#ply3 <- ggplotly(p3)
#ply3
p3

7.1.3.0.4 Close Price
rm(p3)

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p4 <- yr_2018 %>% 
  ggplot(aes(x = index, y = close, group = Model, color = Model)) + 
  geom_line() + 
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Close Price Forecasting', 
       subtitle = paste('From', range(unique(yr_2018$index))[1], 'to', range(unique(yr_2018$index))[2]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

## Due to heavily loading in plotly graph, here I use ggplot.
#ply4 <- ggplotly(p4)
#ply4
p4

## https://www.r-graph-gallery.com/line-chart-several-groups-ggplot2.html
p5 <- mDT %>% 
  ggplot(aes(x = index, y = Price, group = Model, color = Model)) + 
  geom_line() + 
  #scale_colour_gradient2_tableau(palette = names(palettes)[1]) + #first palettes list in name
  #scale_color_viridis(discrete = TRUE) + 
  labs(title = '1 min Open Price Forecasting', 
       subtitle = paste('From', range(unique(mDT$index))[1L], 'to', range(unique(mDT$index))[2L]), 
       caption = "Data source: fxcm") + 
  ylab('Exchange Rates USD/JPY') + 
  theme_economist() + 
  #scale_color_economist() + 
  ##scale_fill_manual(values = tableau_colours) + 
  #scale_color_brewer(tableau_colours) + 
  #scale_color_jcolors(palette = palettes2$`Tableau 20`$value) + #choose color set among palettes
  #theme(axis.text.x = element_text(hjust = c(0, 0.5, 0.5, 0.5, 1))) + 
  theme(legend.position = 'right')

## Due to heavily loading in plotly graph, here I use ggplot.
#ply5 <- ggplotly(p5)
#ply5
p5

Kindly refer to Traceback-HFT.R for more information. Here I tried to recalculate dataset from year 2018-01-01 to 2018-07-09 but the outcome is same. Here I forced to omit the mentioned dataset.

## ------------ eval = FALSE -------------------
## Due to high volume dataset and heavily ploting, here I ommit it.
yr_2018 %>% 
    group_by(Model) %>% 
    e_charts(x = index) %>% 
    e_line(open.Point.Forecast, smooth = TRUE) %>% 
  e_datazoom(
    type = 'slider', 
    toolbox = FALSE,
    bottom = -5) %>% 
  e_tooltip() %>% 
  e_title(text = 'Model', subtext = 'open.Point.Forecast', left = 'center') %>% 
  e_axis_labels(x = 'index', y = 'open.Point.Forecast') %>%
  e_x_axis(index, axisPointer = list(show = TRUE)) %>% 
  e_legend(
    orient = 'vertical', 
    type = c('scroll'), 
    #selectedMode = 'multiple', #https://echarts.apache.org/en/option.html#legend
    #selected = list('Model'), 
    left = 0, top = 80) %>% 
  e_grid(left = 150, top = 90) %>% 
  #e_theme('shine') %>% 
  e_toolbox_feature('saveAsImage', title = 'Screenshot')

7.2 Documenting File Creation

It’s useful to record some information about how your file was created.

  • File creation date: 2018-08-28
  • File latest updated date: 2021-01-22
  • R version 4.0.3 (2020-10-10)
  • R version (short form): 4.0.3
  • rmarkdown package version: 2.6
  • File version: 1.0.1
  • Author Profile: ®γσ, Eng Lian Hu
  • GitHub: Source Code
  • Additional session information:
suppressMessages(require('dplyr', quietly = TRUE))
suppressMessages(require('magrittr', quietly = TRUE))
suppressMessages(require('formattable', quietly = TRUE))
suppressMessages(require('knitr', quietly = TRUE))
suppressMessages(require('kableExtra', quietly = TRUE))

sys1 <- devtools::session_info()$platform %>% 
  unlist %>% data.frame(Category = names(.), session_info = .)
rownames(sys1) <- NULL

sys2 <- data.frame(Sys.info()) %>% 
  mutate(Category = rownames(.)) %>% .[2:1]
names(sys2)[2] <- c('Sys.info')
rownames(sys2) <- NULL

if (nrow(sys1) == 9 & nrow(sys2) == 8) {
  sys2 %<>% rbind(., data.frame(
  Category = 'Current time', 
  Sys.info = paste(as.character(lubridate::now('Asia/Tokyo')), 'JST🗾')))
} else {
  sys1 %<>% rbind(., data.frame(
  Category = 'Current time', 
  session_info = paste(as.character(lubridate::now('Asia/Tokyo')), 'JST🗾')))
}

cbind(sys1, sys2) %>% 
  kbl(caption = 'Additional session information:') %>% 
  kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive')) %>% 
  row_spec(0, background = 'DimGrey') %>% 
  row_spec(9, bold = T, color = 'white', background = '#D7261E')
Additional session information:
Category session_info Category Sys.info
version R version 4.0.3 (2020-10-10) sysname Windows
os Windows 10 x64 release 10 x64
system x86_64, mingw32 version build 19042
ui RTerm nodename SCIBROKES-TRADI
language en machine x86-64
collate English_World.1252 login Owner
ctype English_World.1252 user Owner
tz Asia/Tokyo effective_user Owner
date 2021-01-22 Current time 2021-01-22 06:13:14 JST<U+0001F5FE>

  1. For buying order, we need to refer to ask price and selling order need to refer to bid price.↩︎

  2. Seasonal periods describe very details on the seasonal period parameters determination.↩︎

  3. help of auto.arima() describe the seasonal : If FALSE, restricts search to non-seasonal models.↩︎